0% found this document useful (0 votes)
37 views2 pages

A. Answer The Following MCQS.: Student Id

The document contains questions about computer architecture and AVR microcontrollers. It asks multiple choice questions about binary encoding, memory addressing, AVR registers and instructions. It also provides some AVR assembly code examples and asks to translate instructions and write a simple assembly program.

Uploaded by

nancyrazzak5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

A. Answer The Following MCQS.: Student Id

The document contains questions about computer architecture and AVR microcontrollers. It asks multiple choice questions about binary encoding, memory addressing, AVR registers and instructions. It also provides some AVR assembly code examples and asks to translate instructions and write a simple assembly program.

Uploaded by

nancyrazzak5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CENG380- Spring2021 – Assignment1

Student name: ___________ Student id: ___________


A. Answer the following MCQs.
1) What is the minimum number of bits needed to give a binary encoding for 17 items?
a. 2
b. 3
c. 4
d. 5
2) What is the size of the address bus of a 1Kbyte memory with 1 byte per memory location?
a. 12
b. 11
c. 10
d. 20
3) If a memory has 22 bits address bus, what is in HEX the address of the last memory location of this memory?
a. 0x45FFFE
b. 0x3FFFFF
c. 0xFFFFFF
d. 0x0000000
4) If an AVR RAM has a 1Kbyte capacity, what is the maximum number of instructions that you can place in this
memory?
a. We do not put instructions in RAM of AVR
b. 512 Instructions
c. 1024 Instructions
d. 256 Instructions
5) What is the size of the program counter (PC) for an AVR that has a 1Kbyte ROM capacity?
a. 6 bits
b. 7 bits
c. 8 bits
d. 9 bits
6) What register(s) is(are) affected when executing the instruction SUB R5, R16?
a. Register R16 and Register R5
b. Register R5 and Register R4
c. Register R5 and Status Register
d. No registers will be affected
7) If the value of R5 is 0xFF, what will be the new value of R5 after executing INC R5?
a. 0xFE
b. 0x00
c. 0xFF
Question Answer
d. R5 is not affected 1
8) What is the address of the first SFR (I/O Register)? 2
a. 0x20 3
b. 0x00 4
c. 0x32 5
d. 0xFF 6
9) How many GPRs in ATMEGA?
7
a. 20
b. 22 8
c. 30 9
d. 32 10
10) How many status registers are used in ATMEGA?
a. 1 S
b. 2
c. 3
d. 4

1
This study source was downloaded by 100000827572796 from CourseHero.com on 03-13-2022 11:33:37 GMT -05:00

https://www.coursehero.com/file/94705487/CENG380-Assignment1-soldocx/
B. Translate the following instructions and color the corresponding opcode and operands:

Instruction Word Binary Hex

LDI R18, 2 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0xE022


LDI R19, 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0xE030

LDI R21, 18 1 1 1 0 0 0 0 1 0 1 0 1 0 0 1 0 0xE152

ADD R19, R18 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 0 =0x0 F32

1 0 0 1 0 0 1 1 0 0 1 1 0 0 0 0 =0x9330
STS 0x607, R19
0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 =0x0607

DEC R21 1 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0x9 55A

C. Write an AVR assembly program to increment the contents of the RAM


location 0x600
.org 0x00

LDS R25, 0x600


INC R25
STS 0x600, R25
D. What is the value of the status register after performing the following code:

LDI R16, 0x49


LDI R17, 0xA8
ADD R17, R16

The status register is equal to 0011 0100 = 0x34

This study source was downloaded by 100000827572796 from CourseHero.com on 03-13-2022 11:33:37 GMT -05:00

https://www.coursehero.com/file/94705487/CENG380-Assignment1-soldocx/
Powered by TCPDF (www.tcpdf.org)

You might also like