0% found this document useful (0 votes)
70 views8 pages

Page 1 of 8

The document is a makeup exam for an embedded controllers course. It contains instructions for a 1 hour and 20 minute exam with 6 problems testing students' knowledge of topics like data sizes, number representations, memory addressing, and ARM assembly instructions. Students are not allowed to use notes or access non-course websites during the exam.

Uploaded by

Sushma Reddy
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)
70 views8 pages

Page 1 of 8

The document is a makeup exam for an embedded controllers course. It contains instructions for a 1 hour and 20 minute exam with 6 problems testing students' knowledge of topics like data sizes, number representations, memory addressing, and ARM assembly instructions. Students are not allowed to use notes or access non-course websites during the exam.

Uploaded by

Sushma Reddy
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/ 8

MSET 5300 Embedded Controllers - Spring 2016

TEST #1 Makeup
October 6, 2016

Name:_________________________________

UNT ID#:______________________________

INSTRUCTIONS
Attempt each problem even if you are not sure about your
solution.
You have 1 hour and 20 minutes: 11:30 AM 12:50 PM
You will have full access to the course (Blackboard) web site
during the test but you are not allowed to access web sites
other than the ones in Blackboard.
You are NOT allowed open textbooks or notes.
During the test the use of electronic devices such as cell
phones, smart phones, smart watches, pagers, photographic
devices and/or other electronic or communication devices is
strictly prohibited. Such devices must be turned off during
the tests.

Page 1 of 8

Problem 1 (15 points)


1. How many bits in an ARM halfword? ________
2. How many bytes in an ARM word? ________
3. How many nibbles in an ARM word? ________
4. How many bits in an ARM quadword? ________
5. How many bits in an Intel word? ________
6. How many bits in 4Kb? ________
7. How many bytes in 3Kb? ________
8. How many bytes in 5Kb? ________
9. How many MB in 1GB? ________
10.

How many Mb in 256KB? ________

11.

How many bytes in 0x1000 bits? ________

12.

How many GB in 10TB? ________

13.

How many GB in 10Tb? ________

14.

How many Ohms in a megaohm? ________

15.

How many Farads in a nanofarad? ________

Page 2 of 8

Problem 2 (15 points)


You have a register with n = 16 bits. Numbers are unsigned.
1) How many different numbers can you represent in this register?
________
2) What is the minimum number in hex and decimal? ________
3) What is the maximum number in hex and decimal? ________
4) Show in hex (make sure you use the correct number of digits) the
equivalent of these bit patterns:
a. 00
________
b. 110010
________
c. 1001
________
d. 11110011 ________
5) Show in binary the equivalent for this register of the following
numbers:
a. 0xFFE
________
b. 0xAAF
________
c. 0x1A5
________
d. 4000
________

Page 3 of 8

Problem 3 (15 points)


You have a register with n = 8 bits. Numbers are signed in 2s
complement representation.
1) How many different numbers can you represent in this register?
________
2) What is the minimum number in hex and decimal? ________
3) What is the maximum number in hex and decimal? ________
4) Show
sign
a.
b.
c.
d.

in hex (make sure you use the correct number of digits AND
extension) the equivalent of these bit patterns:
00
________
110010
________
0010
________
11110011 ________

5) Show in binary
numbers:
a. 0xFF
b. 0xA
c. 0x1A
d. 400

the equivalent for this register of the following


________
________
________
________

Page 4 of 8

Problem 4 (15 points)


Answer the following questions.
1. An SRAM has organization 1Mx4.
What is its capacity in bits? ______________________
In bytes?______________________
2. A ROM has 12 address lines and capacity 4KB. What is its word
size (number of output pins)? ______________________
3. A processor has a 16-bit address bus. Give (in hex) the lowest
______________________ and highest ______________________
address.
4. A processor has a 16-bit address bus. The memory space is
divided into 4 equal segments. The first segment starts at
address 0.
What is the starting ______________________
and ending addresses ______________________ (in hex)
of the 1st segment?
What is the starting ______________________
and ending addresses ______________________ (in hex)
of the 2nd segment?
What is the starting ______________________
and ending addresses ______________________ (in hex)
of the 3rd segment?
What is the starting ______________________
and ending addresses ______________________ (in hex)
of the 4th segment?
5. A ROM has capacity 16KB and word size 4. How many address pins
does it have? ______________________

Page 5 of 8

Problem 5 (15 points)


Manually assemble the following ARM Cortex-M4. Give the results as a
32-bit hex number.
ADDS R1, R1, #0x29
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

ADD

R3, R3, R2

3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

SUBS R1, R5, R4


3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

SUB

R1, R0, #-8

3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

Hint: DO NOT use the Keil IDE. The assembler performs internal
optimizations and you will not see what you expected.

Page 6 of 8

Problem 6 (25 points)


Consider the following ARM Cortex-M4 assembly language program:
LDR R1, =0x00001000
LDRH R0, [R1]
LDR R2, [R0]
STRB R2, [R1]
Memory locations 0x1000-1003 contain 0xFFFF2000, memory locations
0x2000-2003 contain -7, memory locations 0xFFF9-FFFC contain 0xABCD1000
and memory locations 0XFFFF2000-FFFF2003 contain 0x10001000, all in
little-endian mode. The instructions are executed one after the other.
At the beginning of execution all general purpose registers contain the
value 0. Answer the following questions in hex with the appropriate
number of digits:
1) Before execution:
what is the value of R0 _____________________?
what is the value of R1 _____________________?
what is the value of R2 _____________________?
what is the value of R3 _____________________?
2) After execution of LDR R1, =0x00001000
what is the value of R0 _____________________?
what is the value of R1 _____________________?
what is the value of R2 _____________________?
what is the value of R3 _____________________?
what is the value at 0x1000-1003 _____________________?
what is the value at 0x2000-2003 _____________________?
what is the value at 0xFFFF2000-0xFFFF2003 _____________________?

Page 7 of 8

3) After execution of LDRH

R0, [R1]

what is the value of R0 _____________________?


what is the value of R1 _____________________?
what is the value of R2 _____________________?
what is the value at 0x1000-1003 _____________________?
what is the value at 0x2000-2003 _____________________?
what is the value at 0xFFFF2000-0xFFFF2003 ____________________?

4) After execution of LDR R2, [R0]


what is the value of R0 _____________________?
what is the value of R1 _____________________?
what is the value of R2 _____________________?
what is the value at 0x1000-1003 _____________________?
what is the value at 0x2000-2003 _____________________?
what is the value at 0xFFFF2000-0xFFFF2003 _____________________?

5) After execution of STRB

R2, [R1]

what is the value of R0 _____________________?


what is the value of R1 _____________________?
what is the value of R2 _____________________?
what is the value at 0x1000-1003 _____________________?
what is the value at 0x2000-2003 _____________________?
what is the value at 0xFFFF2000-0xFFFF2003 ____________________?

Page 8 of 8

You might also like