Midterm Solutions

sanatoriumdrumΗλεκτρονική - Συσκευές

25 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

101 εμφανίσεις

San José State University

College of Engineering/Electrical Engineering

EE138: Introduction to Embedded Control System Design



Fall 2013


Midterm

(60 pts)



1)

(8 pts)
Problem

#1:

a.

What is the OSI model?

b.

What are the layers of the OSI model?

c.

Give examples o
f two protocols under each layer.

d.

Where in the Embedded Systems model does each layer of the OSI model
fall? Draw it.


2)

(6 pts)
Problem #2:

a.

What are gates
?

b.

What are gates typically designed to perform?

c.

Draw the truth tables for the logical binary ope
rations NOT, NAND, and
AND.


3)

(8 pts)
Problem #3:

a.

What is an ISA?

b.

What features does an ISA define?

c.

Name and describe the three most common ISA models in which architectures
are based?

d.

Name and describe two types of

ISAs that fall under each of the three

ISA
models.

e.

Give four real
-
world processors that fall under the types of ISAs listed in [
d
].


4)

(6 pts)
Problem #4:


a.

What is a register
?

b.

Name and describe the two types of registers that most fall under.


5)

(8 pts)
Problem #5:

a.

Draw and describe the memory hi
erarchy of an embedded system.

b.

What are the types of memory that can be integrated into a processor?

c.

What is the difference between level
-
1, level
-
2, and level
-
3 cache.

d.

How do they all work together in a system?


6)

(8 pts)
Problem #6:

a.

What is ROM?

b.

Describe
3 types of ROM

c.

What is RAM?

d.

Describe 2 types of RAM

7)

(8 pts)
Problem #
7
:

a.

Bitwise Operations: Given an unsigned character y = 0xC3

or 0xC8
, find x:


Operation





Result

x = ~y;




x =
???

x = y << 3;



x = ???

x = y >> 4;



x = ???

x = y & 0x3F;



x = ?
??

x = y ^ 1;



x =
???

x = y | 0x10;



x =
???


b.


Increment, decrement and conditional expression:


i = 1;

k = 2 * i++;




at completion, k =
???

and i =
???


-

-

j



at completion, j = ???


(z

<
4
) ? y = 1 : y = 0;


at completion, y = ???
if z = 3

(z < 4) ? y = 1 : y = 0;

at completion, y = ???
if z = 5









8)

(8 pts)
Problem #8:


Evaluate as true or false as if used in a conditional statement
:


F
or all problems:
x = 0x45;

y = 0x
C
6


a.

(x == 0x45)

b.

(x | y)

c.

(x > y)

d.

(y


0x06 == 0x
C
)





















Problem #1
Answer:


[a] A model created in the early 1980s by the International Organization for
Standardization (ISO) to reflect the major networking components required in a computer
system.


[b] physical, data
-
link, network, transpor
t, session, presentation, and application layers


[c] (anything shown in text) i.e., physical (Ethernet, CDMA), data
-
link (Ethernet, FDDI),
network (IP, VIP), transport (TCP,UDP), session (DNS,NFS), presentation(JPEG,MIDI),
and application layers(HTTP,FTP)



[d]












Problem #2 Answer:


[a] More complex types of electronic switching circuits, also referred to as logic circuits.


[b] Gates are designed to perform logical binary operations, such as AND, OR, NOT,
NOR, NAND, XOR, ...


[c]

AND


NOT



NAND



I1

I2

O


I1

O


I1

I2

O

0

0

0


0

1


0

0

1

0

1

0


1

0


0

1

1

1

0

0





1

0

1

1

1

1





1

1

0





H
H
a
a
r
r
d
d
w
w
a
a
r
r
e
e


L
L
a
a
y
y
e
e
r
r







S
S
y
y
s
s
t
t
e
e
m
m


S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e


L
L
a
a
y
y
e
e
r
r





A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n


S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e


L
L
a
a
y
y
e
e
r
r









P
P
h
h
y
y
s
s
i
i
c
c
a
a
l
l




L
L
a
a
y
y
e
e
r
r

D
D
a
a
t
t
a
a
-
-
L
L
i
i
n
n
k
k


L
L
a
a
y
y
e
e
r
r

N
N
e
e
t
t
w
w
o
o
r
r
k
k


L
L
a
a
y
y
e
e
r
r

T
T
r
r
a
a
n
n
s
s
p
p
o
o
r
r
t
t


L
L
a
a
y
y
e
e
r
r

S
S
e
e
s
s
s
s
i
i
o
o
n
n


L
L
a
a
y
y
e
e
r
r

P
P
r
r
e
e
s
s
e
e
n
n
t
t
a
a
t
t
i
i
o
o
n
n


L
L
a
a
y
y
e
e
r
r

A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n


L
L
a
a
y
y
e
e
r
r

OSI Model


Problem #3 Answer:


[a] The features that are built into an architecture’s instruction set are commonly referred
to as the Instruction Set

Architecture(ISA)



[b] ISAs typically define such features as the operations that can be used by programmers
to create programs for that architecture, the operands [data] that are accepted and
processed by an architecture, operand storage, addressing mod
es used to gain access to
and process operands, an
d the handling of interrupts.


[
c
] The most commonly implemented ISA models are application
-
specific (typically
define processors that are intended for specific embedded applications), general purpose
(t
ypically implemented in processors that are targeted to be used in a wide variety of
embedded systems, rather than in specific types of embedded systems and only those
types of systems), and instruction
-
level parallel (similar to general
-
purpose ISAs, exce
pt
that they execute multiple instructions in parallel).


[
d
] and [
e
] students search on internet for specific processors of each type
--

i.e.,

application
-
specific : JVM (aj100,...), FSMD(ASICS, PLDs, ...), Datapath (DSPs,...)

general purpose : CISC (x86
, 68K,...), RISC (PPC, MIPS,...)

instruction
-
level parallel : SIMD (oti4110,...), Superscaler(tricore), VLIW(TL1100,....)


Problem #4 Answer:

[a] Registers are simply a combination of various flip
-
flops that can be used to
temporarily store data or delay

signals (a type of fast memory).


[b] A storage register is simply a form of fast programmable internal processor memory
usually used to temporarily store, copy, and modify operands that are immediately or
frequently used by the system. Shift registers d
elay signals by simply passing the signals
between the various internal flip
-
flops with every clock pulse.


Problem #5 Answer:


[a]
The memory hierarchy is a collection of different types of memory, each with unique
speeds, sizes, and usages. Some of this
memory can be physically integrated on the
processor, such as registers, Read
-
Only Memory (ROM), certain types of Random
Access Memory (RAM), and level
-
1 cache. While level
-
2+ cache, other types of main
and secondary memory are located on the board.


[b]
Read
-
Only Memory (ROM), certain types of Random Access Memory (RAM), and
level
-
1 cache



[c]
Level
-
1 cache is cache located with the master processor. Level 2+ (level 2 and
higher) cache is the level of memory that exists between the CPU and main memory o
n
the main board in the memory hierarchy.



[d]
Level
-
1 cache is the first cache checked for data. Level 2+ (level 2 and higher) cache
is checked if data is not found in level
-
1 cache (level
-
2 and then level
-
3).


Problem #
6

Answer:



[a] Read
-
Only Memory

(ROM) is a type of non
-
volatile memory that can be used to
store data on an embedded system permanently, typically through a small on
-
board
battery that is separate from the board’s main power source.


[b]

1) One
-
Time Programmable ROM (OTP or OTPRom);
This type of ROM can
only be programmed (permanently) one time as its name implies, but it can be
programmed outside the manufacturing factory, using a ROM burner.


2) Erasable Programmable ROM (EPROM) ; An EPROM can be erased more
than one time using oth
er devices that output intense short wavelength, ultraviolet light
into the EPROM package’s built
-
in transparent window. (In fact OTPs are one
-
time
programmable EPROMs without the window to allow for erasure; the packaging without
the window used in OTPs i
s cheaper.)

3) Electrically Erasable Programmable ROM (EEPROM); like EPROM,
EEPROMs and can be erased and reprogrammed more then once (the number of times
erasure and re
-
use also occur depends on the EEPROM). Unlike EPROMs, the content of
EEPROM can be wri
tten and erased “in bytes” without using any special devices. In
other words, the EEPROM can stay on its residing board, and the user can connect to the
board interface to access and modify EEPROM.


[
c
] RAM (Random Access Memory), commonly referred to as

main memory, is memory
in which any location within it can be accessed directly (randomly, rather than
sequentially from some starting point), and whose content can be changed more than
once (the number depending on the hardware). Unlike ROM, contents of

RAM are erased
if RAM loses power, meaning RAM is volatile.


[
d
]

1) BSRAM (Burst/SynchBurst StaticRandom
-
Access Memory ) is SRAM that is
synchronized with either the system clock or a cache bus clock.

2) Enhanced Dynamic Random
-
Access Memory (EDRAM)
actually integrates
SRAM within the DRAM, and is usually used as level
-
2 cache. The faster SRAM
portion of EDRAM is searched first for the data, and if not found there, then the DRAM
portion of EDRAM is searched.

3) FRAM (Ferroelectric Random
-
Access Mem
ory) Non
-
volatile DRAM, meaning
data isn’t lost from DRAM when power is shut off. FRAM has a lower power
requirement then other types of SRAM, DRAM, and some ROMs (ie: Flash) , and is
targeted for smaller handheld devices (ie: PDAs, phones, etc.).





Pro
blem #
7
Answer:


[a]
Bitwise Operations: Given an unsigned character y = 0xC3

or 0xC8, find x:


Operation

Result of x, if y = 0xC3

Result of x, if y = 0xC8

x = ~y;

3C

37

x = y << 3;

18

40

x = y >> 4;

0C

0C

x = y & 0x3F;

03

08

x = y ^ 1;

C2

C9

x =
y | 0x10;

D3

D8



[b]
Increment, decrement and conditional expression:


i = 1;

k = 2 * i++;




//
at completion, k =
2

and i =
2


-

-

j



// at completion, j = j
-

1


(z

<
4
) ? y = 1 : y = 0;


// at completion, y = 0 if z = 5








y = 1

if z = 3




Problem #
8

Answer:


E
valuate as true or false as if used in a conditional statement:

For all problems: x = 0x45;

y = 0x
C
6


[a]

(x == 0x45)


Answer:

TRUE


[b]

(x | y)

Answer:

TRUE (since 0x45 | 0xC6 = 0xC7, and 0xC7 is not zero)


[c] (x > y)

Answer: FALSE


[d] (y


0x06 == 0xC)

Answer:

FALSE (since 0xC6


0x06 = 0xC0, and that is not equal to 0x0C)