Docsity

ECE2030: Introduction to Computer Engineering Final Exam, Exams of Computer Science

Toggle sidebar
bg1
STUDENT NAME and NUMBER: (PLEASE PRINT CLEARLY)
REMARKS: 1. All questions should be answered (in the space provided).
2. Books and notes may NOT be used.
3. Calculators are allowed.
4. You are allowed two 8.5โ€x11โ€ crib sheets.
5. The exam is 2 hours and 50 minutes.
DATE: April 30, 2001 TIME: 2:50 p.m. - 5:40 p.m.
Marks:
Total:
Q1
Q2
Q3
Q4
v. 1.1 - 1 of 9 -
Georgia Institute of Technology
Department of Electrical and Computer Engineering
Final Exam
ECE2030: Introduction to Computer Engineering
Q5
Q6
Q7
Q8
/100
/10
/15
/10
/10
/10
/10
/15
/20
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download ECE2030: Introduction to Computer Engineering Final Exam and more Exams Computer Science in PDF only on Docsity!

STUDENT NAME and NUMBER: (PLEASE PRINT CLEARLY)

REMARKS: 1. All questions should be answered (in the space provided).

  1. Books and notes may NOT be used.
  2. Calculators are allowed.
  3. You are allowed two 8.5โ€x11โ€ crib sheets.
  4. The exam is 2 hours and 50 minutes.

DATE: April 30, 2001 TIME: 2:50 p.m. - 5:40 p.m.

Marks:

Total:

Q

Q

Q

Q

Georgia Institute of Technology Department of Electrical and Computer Engineering

Final Exam

ECE2030: Introduction to Computer Engineering

Q

Q

Q

Q

1. SWITCH DESIGN (MAX MARK: 10)

For the two expressions below, create a switch level implementation using nMOS and pMOS transistors. Assume that you also have the complements of each input.

Out 1 = A + B C ( + D ) Out 2 = A BC ( + D ) + E

B

C

B

D

A

V DD

A

Out (^1)

D

C

B

C

B

D

A

V DD

A

Out (^2)

D

C

E

E

3. BOOLEAN SIMPLIFICATION (MAX MARK: 10)

For the following Karnaugh map, derive a simplified product of sums ( POS ) expression. Be sure to circle and list the prime implicants, indicating which are essential. Write the simplified POS expression in the space below.

4. COMBINATIONAL LOGIC MODULES (MAX MARK: 10)

The table below shows a 3-bit gray code and 3-bit binary code. Design a circuit using a three-input binary decoder and an eight-input binary encoder that can convert a three-bit Gray code input into a three-bit binary code.

prime implicants

essential? yes no

AB

CD

C

A

B

D D D

B

B

C

A

X=

X=1 1

X=1 1

X=

B + C

B + C + D

A + B + D

A + C + D

(POS)^ F A B C D (^ ,^ ,^ , )^ = (^ B^ + C )^ (^ B^ +^ C^ + D )^ (^ A^ +^ B^ + D )

F A B C D ( , , , ) = ( B + C ) ( B + C + D ) ( A + C + D )

or

Binary Code

Gray Code

Decimal Digit

3-to-8Decoder

0 1 2 3 4 5 6 7 2 0

2 1

2 2

I 0

I 1

I 2

8-to-3Encoder

0 1 2 3 4 5 6 7 20

21

22

D (^0)

D (^1)

D (^2)

5. STATE MACHINES (MAX MARK: 15)

a) Drawn below is an implementation of a state machine. Write out the Boolean equations for , , and for this state machine in terms of , and.

b) Develop the state table for these equations.

c) Draw the state diagram for this state machine. Assume that is the initial state.

d) Is this a Mealy or a Moore machine? Moore machine.

NS 1 NS 0

Z X PS 1 PS 0

PS 0

NS 0

FF

PS 1

NS 1

FF

Z

X

NS 1 = X โ‹… PS 1 NS 0 = PS 1 โŠ• PS 0 Z = PS 1 + PS 0

Present State Input Next State Output

0 1 0 1 0 1 0 1 S 0 or 0 0

PS 1 PS (^0) X Z

S 0 or 0 0 S 1 or 0 1 S 1 or 0 1 S 2 or 1 0 S 2 or 1 0 S 3 or 1 1 S 3 or 1 1

NS 1 NS 0 0 0 1 1 1 1 1 1 S 3 or 1 1 S 3 or 1 1 S 2 or 1 0 S 2 or 1 0 S 2 or 1 0 S 0 or 0 0 S 3 or 1 1 S 1 or 0 1

S (^0)

S 0 โ„ 0 S 1 โ„ 1 S^2 โ„^1 S^3 โ„^1

8. PROCEDURE CALL (MAX MARK: 20)

a) In the code below, identify each push or pop by circling the instructions associated with each push or pop. Write to the side of each circle either โ€œpush โ€ or โ€œpop โ€ with the appropriate register value. 0x0000 again: jal func 0x0004 subi $8, $8, 0x 0x0008 beq $8, $0, out 0x000C j again 0x0010 out: ... ... 0x0100 func1: lw $24, $sp 0x0104 addi $sp, $sp, 0x04 pop $ 0x0108 lw $25, $sp 0x010C addi $sp, $sp, 0x04 pop $ 0x0110 slt $9, $24, $ 0x0114 beq $9, $0, func1end 0x0118 subi $sp, $sp, 0x 0x011C sw $25, $sp push $ 0x0120 jr $ra 0x0124 func1end: subi $sp, $sp, 0x 0x0128 sw $24, $sp push $ 0x012C jr $ra

b) What is the type of branch (i.e. ble, bge, blt, bgt) that is being done in the procedure call. Write to the side of the branch the effective branch type โ€œbxx โ€.

bge $24, $25, func1end

c) What simple function is โ€œfunc1โ€ actually performing?

Finds the maximum of the two top items on the stack and pushes this maximum back on the stack.

d) Using the initial condition that $8 = 0x04 and the stack is as shown on the left below before running this code, show how the stack changes every time that func1 is called..

e) What is the value at the top of the stack when the instruction at 0x0010 is reached? f) Fill in below the instruction set architecture bits needed to encode the instruction at address 0x0008.

0xF 0xF 0xF 0xF00C 0xF 0xF 0xF

0x 0x 0x 0x 0x 0x 0x

SP

0x 0x 0x 0x 0x 0x 0x

0x 0x 0x 0x 0x 0x 0x

0x 0x 0x 0x 0x 0x 0x

0x 0x 0x 0x 0x 0x 0x

SP

SP

SP

SP

0x

beq opcode 01 000 0 0000 0000 0000 0000 0001

src1 src2 word_offset

Zdi

X do

Y do

X ra Y raZwa

32x

RF

rwe

32 X bus^ Y bus

Z bus

ALU

A B

a en

a/s

ST

LF

asl

Clk

sign extender

im en im va

RAM/ROM

addr

data

TG

TG

st en

ld en

r/w msel

X- register driven onto X bus Y- register driven onto Y bus Z- register written from Z bus rwe - register write enable

X Y Z

im en - immediate register enable

For all enables, 0=disable and 1=enable

a en - ALU enable LF - 4 bit logical function

A B

Logical Function LF LF 0 LF 1 LF 2 LF 3

ST - 2 bit shift type

Shift Types 00 = Logical 01 = Arithmetic 10 = Rotate

Shift Direction (B on ALU) positive B = shift right negative B = shift left

im va - immediate value st en - store enable ld en - load enable

a/s - add or subtract (add=0, sub=1) asl - arithmetic unit, shift unit, logical unit select

r/w - memory read/write (read=0,write=1) msel - memory select

asl 00 - select arithmetic unit 01 - select shift unit 10 - select logical unit