Docsity

Exam-Microcomputers-Exam Paper 01-Electrical and Computer Engineering, Exams of Microcomputers

Toggle sidebar
bg1
ECE383 Sample questions for Exam #1 The exam will be closed book/notes.
1. Convert the following to their equivalent 8-bit hexadecimal values:
10111010b _____0xBA__________
93 _____0x5D__________
-27 (2’s complement format) _____0xE5__________
2. Give the range of numbers that can be represented in 10 bits using a 2’s complement number format.
-2
(N-1)
-> +2
(N-1)
-1 = -2
9
-> +2
9
-1= -512 -> +511
3. Given a 40% duty cycle clock with a low clock width of 20 ns, what is the clock frequency in MHz?
If the clock has a 40% duty cycle, then 60% of the time the clock is low.
Therefore 20ns/.6=33.33ns is the total clock period. The clock frequency is
1/period=1/33.33ns=30MHz.
4. Design a shift left by one combinatorial building block.
5. Show the hardware diagram for the number sequencing computer defined in chapter 2 of the text. Give a brief (1-2
sentences) of each major component).
pf3

Partial preview of the text

Download Exam-Microcomputers-Exam Paper 01-Electrical and Computer Engineering and more Exams Microcomputers in PDF only on Docsity!

ECE383 Sample questions for Exam #1 The exam will be closed book/notes.

  1. Convert the following to their equivalent 8-bit hexadecimal values:

10111010b _____0xBA__________

93 _____0x5D__________

-27 (2’s complement format) _____0xE5__________

  1. Give the range of numbers that can be represented in 10 bits using a 2’s complement number format.

-2 (N-1)^ -> +2 (N-1)^ -1 = -2 9 -> +2 9 -1= -512 -> +

  1. Given a 40% duty cycle clock with a low clock width of 20 ns, what is the clock frequency in MHz?

If the clock has a 40% duty cycle, then 60% of the time the clock is low. Therefore 20ns/.6=33.33ns is the total clock period. The clock frequency is 1/period=1/33.33ns=30MHz.

  1. Design a shift left by one combinatorial building block.
  2. Show the hardware diagram for the number sequencing computer defined in chapter 2 of the text. Give a brief (1- sentences) of each major component).

OUTREG is a 4-bit register to hold the output from the OUT instructions. It is loaded with a 4-bit value from memory when the OUT instruction is executed.

PC is a 4-bit up counter that acts as the program counter for the simple computer. Its value is normally increments except when a branch is taken. In that case, the value loaded into the PC is a 4-bit value taken from memory.

The 16x6 memory holds the instructions to be executed by the simple computer. Each instruction is a 6-bit value consisting of s 2-bit OPCODE and a 4-bit field representing either a value to output or a new value to be loaded into the PC register.

The LOC input, along with the 2-bit OPCODE value act as inputs to the control logic which controls how the PC register operates.

  1. Convert the following instructions into their machine language equivalent:

MOV.B #0xE3,W4 __0xB3CE34_______________

ADD 0x0804,WREG __0xB40804_______________

MOV [W2],W6 __0x780312_______________

  1. Assume the contents of data memory and working registers are as given below.

Location Value Location Value

W0 0x1000 0x800 0xAA

W1 0x2000 0x801 0xBB

W2 0x3000 0x802 0xCC

W3 0x0803 0x803 0xDD

Give the value of the modified memory location or register for each of the following instructions:

MOV.B [W3],W0 __0x10DD_________

MOV W1,0x800 __0x2000_________

ADD 0x0802,WREG __0xEDCC_________

SUB 0x0802,WREG __0xCDCC_________

  1. Write PIC24 assembly language equivalents for the following C code fragments:

while (u16_i != u16_k) { loop body statements }

loop_top: mov u16_k,WREG cp u16_i bra Z,loop_end ; loop body bra loop_top loop_end:

while ((u8_x != 0) && (u8_y < u8_z)) { loop body statements }