Docsity

Digital Computing: Midterm Solutions - Logic Diagrams, Expressions, and VHDL Module, Exams of Digital Logic Design and Programming

Toggle sidebar
bg1
- 1 -
1. (8 points) Draw a logic diagram that directly implements the expression
A(B′ + C′D′) + (C + (A′+B′)D)
(do not simplify the expression first).
How many transistors are needed to implement this expression in CMOS technology?
The circuit has 3 AND and 4 OR gates, plus 4 inverters, so that’s 7×6 + 4×2 = 50 transistors.
2. (6 points) The expression A′B + (B
′ + A)C has the minterm A′BC and the maxterm
(A
′ + B + C). List all its other minterms and maxterms.
CS/EE 260 – Digital Computers: Organization and Logical Design
Midterm Solutions
J
on Turner
3/4
/
04
DC
B
A
DDCC
BB
AA
A
BC
X
000 0
001 1
010 1
011 1
100 0
101 1
110 0
111 1
minterms: A′B′C, A′BC ′,AB′C, ABC
maxterms: (A + B+C), (A′+ B′+ C)
A
BC
X
000 0
001 1
010 1
011 1
100 0
101 1
110 0
111 1
A
BC
X
000 0
001 1
010 1
011 1
100 0
101 1
110 0
111 1
minterms: A′B′C, A′BC ′,AB′C, ABC
maxterms: (A + B+C), (A′+ B′+ C)
pf3
pf4
pf5

Partial preview of the text

Download Digital Computing: Midterm Solutions - Logic Diagrams, Expressions, and VHDL Module and more Exams Digital Logic Design and Programming in PDF only on Docsity!

  1. (8 points) Draw a logic diagram that directly implements the expression

A ( B ′ + C ′ D ′) + ( C + ( A ′+ B ′) D )

(do not simplify the expression first).

How many transistors are needed to implement this expression in CMOS technology?

The circuit has 3 AND and 4 OR gates, plus 4 inverters, so that’s 7 × 6 + 4 × 2 = 50 transistors.

  1. (6 points) The expression A ′ B + ( B ′ + A ) C has the minterm A ′ BC and the maxterm ( A ′ + B + C ). List all its other minterms and maxterms.

CS/EE 260 – Digital Computers: Organization and Logical Design

Midterm Solutions

Jon Turner 3/4/

AAA BBB CCC DDD

ABC X

minterms: A ′ B ′ C, A ′ BC ′ , AB ′ C, ABC

maxterms: ( A + B + C ) , ( A ′ + B ′ + C )

ABC X

ABC X

minterms: A ′ B ′ C, A ′ BC ′ , AB ′ C, ABC

maxterms: ( A + B + C ) , ( A ′ + B ′ + C )

  1. (12 points) The simulation output shows selected signals from the processor introduced in section 1 of the course notes. The portions of the output corresponding to four different instructions are outlined. Identify the instructions that are being executed. Give the name of the instruction (e.g. direct load, branch-on-positive) and its complete numeric representation. Note that some parts of the simulation output have been blanked out.

The first instruction changes the ACC but does not access memory, so it must be either an immediate load or a negate instruction. It cannot be an immediate load, since the high order hex digit of the ACC becomes 5 and an immediate load can only make the high order hex digit 0 or F. So, it must be a negate instruction, 0001. This conclusion is confirmed by the fact that the new value of the ACC is the 2s complement of the previous value.

The second instruction also changes the ACC, but does not access memory. Since the new ACC value is not the 2s complement of the previous value, this must be an immediate load 1FFF.

The third instruction does read from memory, so it must be a direct load or an add instruction. Since the value returned from memory (which appears on the data bus) is 0001, and the new ACC value is 0000, it must be an add instruction, and since the value on the address bus is 0008, it must be, A008. This is confirmed by the fact that the new ACC value is 1 more than the previous value.

The last instruction changes the PC, so it must be a branch instruction. In fact, we can see the instruction returned on the data bus in this case is 700d, which is the branch-on-zero instruction.

0000 halt execution 0001 negate the value in the ACC 1xxx change the value of the ACC to xxx 2xxx load the contents of memory location xxx into the ACC 3xxx load the ACC from the memory location whose address is stored in memory location xxx 4xxx store the value in the ACC in memory location xxx 5xxx store the value in the ACC in the memory location whose address is stored in location xxx 6xxx change the value of the PC to xxx 7xxx change the value of the PC to xxx if ACC = 0 8xxx change the value of the PC to xxx if ACC > 0 9xxx change the value of the PC to xxx if ACC < 0 Axxx add the value in memory location xxx to the ACC

  1. (10 points) Draw a logic diagram that directly corresponds to the VHDL module shown below. Use simple gates only. library IEEE; use IEEE.std_logic_1164.all;

entity foo is port ( A: in std_logic; B: in std_logic_vector(3 downto 0); X: out std_logic_vector(2 downto 0)); end foo; architecture a1 of foo is signal Z: std_logic_vector(2 downto 0); begin process(A, B, Z) begin Z(0) <= A xor B(0); for i in 1 to 2 loop Z(i) <= B(i) and Z(i-1); end loop; end process; X(2) <= Z(0); X(1 downto 0) <= Z(2 downto 1); end a1;

A B (0)

B (1)

B (2)

X (0)

X (1)

A X (2) B (0)

B (1)

B (2)

X (0)

X (1)

X (2)

  1. (15 points) Give an expression for output Si of an n input increment circuit. Express Si as a function of the carry input C in and data inputs A 0 , A 1 ,... , Ai.

Si = Ai ⊕ ( C in A 0 A 1... Ai − 1 )

Show that the circuit below implements a 4 bit increment function.

First, note that the NOR gates can be rewritten as AND gates with inverted inputs. With this understanding, we can derive the following equations by inspection of the logic diagram.

2 2 in 0 1 3 3 in 0 1 2 3 in 0 1 2

0 0 in 1 1 in 0 0 in 0 S A C AA S A C AAA A C AA A

S A C S A C A A C A

If a CMOS NAND or NOR gate has a delay of 2 ns and an inverter has a delay of 1 ns, how much faster is a 64 bit version of this circuit than the ripple-carry circuit discussed in class? Explain.

The carry chain substitutes a NAND or NOR in each stage for an AND (which requires a NAND and an inverter), so the circuit saves an inverter delay in each stage, so the delay of the carry chain is about 64 ns faster than the original circuit.

S (^0) S 1

A (^0) A 1

S (^2) S 3

A (^2) A 3

C out

C in

S (^0) S 1

A (^0) A 1

S (^2) S 3

A (^2) A 3

C out

C in