Docsity

Part Implement - Computer Engineering - Solved Exam, Exams of Computer Science

Toggle sidebar
bg1
ECE 2030 1:00pm Computer Engineering Spring 2010
5 problems, 5 pages Final Exam Solutions 5 May 2010
Problem 1 (3 parts, 30 points) Instruction Formats, Etc.
Part A (9 points) Consider the instruction set architecture below with fields containing zeros.
000 0000 00 0000 00 0000 0 0000 0000 0000
opcode dest. reg. source 1 reg. immediate value
What is the maximum number of opcodes? 27 = 128
What is the number of registers? 26 = 64
What is the range of the signed immediate value? 213 = ± 4K
Part B (9 points) Suppose the circuit below has the following input priority: I1 > I3 > I0 > I2.
Complete the truth table by filling in the input values that would produce the given outputs and
derive a simplified expression for O1.
I
3
I
2
I
1
I
0
O
1
O
0
I3I2I1I0V O1O0
0 0 0 0 0 X X
0 X 0 1 1 0 0
X X 1 X 1 0 1
0 1 0 0 1 1 0
1 X 0 X 1 1 1
O1 = I1 (I3 + I0)
Part C (12 points) For each problem below, compute the operations using the rules of arithmetic,
and indicate whether an overflow occurs assuming all numbers are expressed using a six bit
unsigned and six bit two’s complement representations.
101101
+ 10101
11010
+ 10111
10001
- 111010
110101
- 11110
result 000010 110001 010111 010111
unsigned
error? yes no yes no
signed
error? no yes no yes
1
pf3
pf4
pf5

Partial preview of the text

Download Part Implement - Computer Engineering - Solved Exam and more Exams Computer Science in PDF only on Docsity!

5 problems, 5 pages Final Exam Solutions 5 May 2010 Problem 1 (3 parts, 30 points) Instruction Formats, Etc. Part A (9 points) Consider the instruction set architecture below with fields containing zeros. 000 0000 opcode dest. reg.00 0000 (^) source 1 reg.00 0000 0 0000 0000 0000immediate value What is the maximum number of opcodes? (^27) = 128 What is the number of registers? (^26) = 64 What is the range of the signed immediate value? (^213) = ± 4K Part B Complete the truth table by filling in the input values that would produce the given outputs and (9 points) Suppose the circuit below has the following input priority: I 1 > I 3 > I 0 > I 2. derive a simplified expression for O 1.

I 3

I I 21

I 0

O 1

O 0

I 3 I 2 I 1 I 0 V O 1 O 0

0 0 0 0 0 X X

X X 1 X 1 0 1

1 X 0 X 1 1 1

O 1 = I 1 (I 3 + I 0 )

Part C and indicate whether an overflow occurs assuming all numbers are expressed using a (12 points) For each problem below, compute the operations using the rules of arithmetic, six bit unsigned and six bit two’s complement representations.

+ 10101^101101 + 10111^11010 - 111010^10001 - 11010111110

result 000010 110001 010111

unsigned error? yes no yes no signed error? no yes no yes

5 problems, 5 pages Final Exam Solutions 5 May 2010 Problem 2 (4 parts, 32 points) Dueling Designs For each part implement the specified device. Label all inputs and outputs. Part A circuit below using N and P type switches and (8 points) Complete the incomplete write the expression for OutY.

OutY = A+B(C+D)

Part B mixed logic notation using NOR gates. (8 points) Implement the expression in

OUT Z = A  B  C ⋅ D

Part C using a 1 to 2 decoder and basic gates (AND, (8 points) Implement a 2 to 1 MUX OR, NAND, NOR, NOT, & XOR).

Out

In In decoder^ O0^ 1 to 2^ O S EN S

Part D counter using toggle cells and minimum (8 points) Implement a divide by four additional basic gates.

O 0

Ext Clr^ O^1

Ext CE TEOut Clr TEOut Clr

5 problems, 5 pages Final Exam Solutions 5 May 2010 Problem 4 (3 parts, 24 points) Storage Part A Assume both the DRAM cell and the DRAM chip are square. The column number and offset concatenate (12 points) Consider a 4 Gbit DRAM chip organized as 64 million addresses of 64 -bit words. to form the memory address. Using the organization approach discussed in class, answer the following questions about the chip. Express all answers in decimal (not powers of two). total number of bits in address (^) log2(64M) = 26 number of columns (^) sqrt(4G) = sqrt(2^32 ) = 2^16 = 64K column decoder required ( n to m ) (^) 16 to 64K number of words per column (^) 64K / 64 = 1K type of mux required ( n to m ) (^) 1K to 1 number of address lines in column offset (^) log 2 (1K) = 10 Part B latches, (^) (6 points) Implement a register below usingpass gates, and inverters (all in icon form). only Complete the behavior table at right. Recall that the CLK signal indicates a full Φ 1 Φ 2 cycle; so the output should be the value at the end of a cycle (for the given inputs).

In^ Out

φ^1 φ^2

In Out L Eantch

WE

In Out L Eant Ochut (^) Out

Part C the output signal (6 points) Out Assume the following signals are applied to a register with write enable. Draw. Draw a vertical line where In is sampled. Assume Out is initially zero.

Φ^1

Φ^2

WE

In

Out

In WE Clk Out Out

A 0 ↑↓ Qo Qo

A 1 ↑↓ A A

5 problems, 5 pages Final Exam Solutions 5 May 2010 Problem 5 (2 parts, 23 points) Assembly Language Programming Part A counts the number of elements that have the value X (given in register $1), placing the total (15 points) Write a MIPS subroutine CountX that reads in a vector of integers and count in register $2. Assume the length of the vector (# of integer elements) is stored in register $4 and the base address of the vector is in register $5. The size of the vector may be 0. Follow the steps outlined in the comments in the rightmost column below. registers $2 through $5. You may modify only label instruction comment CountX: addi $2, $0, 0 # clear match count ($2 = 0) sll $4, $4, 2 # compute end addr: scale vector # length by 4 and add to base address add $4, $4, $5^ # (2 instructions) Loop: (^) beq $5, $4, Exit # if current elem addr = end address, # then exit loop lw $3, ($5) # load current vector elem bne $3, $1, Skip # if current elem != X then Skip addi $2, $2, 1 # else increment match count Skip: addi $5, $5, 4 # inc vector ptr to next elem j Loop # loop back Exit: jr $31 # return to caller Part B (8 points) Consider the following code fragment. address label instruction (^10001004) Loop2: addi $10, $0, 0lw $1, ($12) 10081012 jalslt CountX$9, $2, $ 10161020 bneadd $9, $0, Continue$10, $2, $ 10210284 Continue: addi $12, $12, 4...

If $10 holds M and $2 holds the result R of subroutine CountX, what simple mathematical expression do^ 1. What is the branch offset (in bytes) for the^ bne^ instruction at 1016?^^4 instructions at addresses 1012-1020 compute (express your answer in terms of M and R, not registers)? 2. Instructions 1012-1020 compute max R returned from CountX (maintained in M) What is the value of $31 after the jal instruction at 1008 is executed?

3. The value of $31 = (^) 1012