Sie sind auf Seite 1von 3

EEE-347 / CNG-336 – Spring 2017

Homework #1 – Due on “26/03/2017 23:59”

1. (6 pts.) Which of the following AVR instructions are illegal and why?

a) ADD R20, R11


b) ADD R16, R1
c) ADD R52, R16
d) LDI R16, $255
e) LDI R23, 0xF5
f) ADD R32, R1

2. (15 pts.) Assume that the following numbers are represented in 8-bit two’s complement
representations. Show the calculations in binary, and state if there is overflow or not.
a) 49-88 b) -89-55 c) 25+107 d) 85-66 e) 55-110

3. (6 pts.) Show the ASCII code of the following string:

<CR><Space>EEE-347<Space> <CR>

4. (5 pts.) Choose one of the following choices (a-d) to best fit the space provided in the
following statements in (i)-(v):

(a) Personal Computer (b) Embedded System (c) Microprocessor (d) Microcontroller

i) Although the new line of Sony entertainment robots seems sophisticated, the code controlling
the motion of the body parts is relatively straightforward; it is stored and executed on a simple
stand-alone ___________________ chip.
ii) Lenovo has announced that it will form a new design team to develop a low power
___________________, which will be used as the brains of its new server products and help
reduce the electricity bills associated with the computing centers.

iii) Even though most customers may not know, one of the independent ___________________s
in a Mercedes is not only able to sense, digitally record, and display the humidity of the
surrounding air, but will also be utilized in a future model to do automatic air humidity
conditioning in tropical regions with the addition of few actuators.

iv) Sharp is adding a new solar tracking system to its fleet of efficient photovoltaic solutions, and
is looking for a business partner to deliver a reliable ___________________ for the system with
a reasonable price tag e.g. few dollars a piece when bought in mass quantities.

v) ___________________s have long ago entered everyday life in different form factors.
Regardless of the performance characteristics, they enable us to perform a variety of distinct
tasks through a direct and simple interface.
5. (6 pts.) Perform the following operation between signed hexadecimal numbers. State if there is
overflow or not.
2FFFFH - FFFFEH

6. (7 pts.) Using NAND gates and inverters, design a decoding circuit for the address range 2000H-
2FFFH.

7. (12 pts.)
a) Which register of the CPU holds the address of the instruction to be fetched from instruction
memory?
b) Which logic block of the CPU is responsible for performing addition?
c) What can be the benefit of having separated data and instruction memory?

8. (10 pts.) Find the address range of the memory design in the following diagram.

9. (11 pts.) Find the time delay for the delay subroutine shown below if the system has an AVR
with a clock frequency of 20 MHz:

LDI R20, 100


BACK: LDI R22, 100
HERE: NOP
NOP
NOP
DEC R22
BRNE HERE
DEC R20
BRNE BACK

10. (11pts.) Write a program to get the state of PB5 and PB6 bits. When both of them are HIGH,
send $FF to PORTC; otherwise send $00 to PORTC.
11. (11 pts.) Find contents of R16, and C, Z, V flags after each of the following code segments is
executed:

a) (5 pt) LDI R16, 0x53


SWAP R16
CLC
ROR R16
ROR R16

b) (5 pt) LDI R16, 0XFF


LDI R17, 0x1
ADD R16, R17

Das könnte Ihnen auch gefallen