5
ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter 2017 1 Instructor: Daniel Llamocca Solutions - Homework 1 (Due date: January 24 th @ 5:30 pm) Presentation and clarity are very important! PROBLEM 1 (25 PTS) a) Simplify the following functions using ONLY Boolean Algebra Theorems. For each resulting simplified function, sketch the logic circuit using AND, OR, XOR, and NOT gates. (9 pts) = ( + )+ ̅ = ( + )( + ) (, , ) = ∏( 0 , 1 , 4 , 5 ) = ( + )+ ̅ = ( ̅ ++ )( ̅ + ) = ̅ ++ = ( + )( + ) = + (, , ) = ∏( 0 , 1 , 4 , 5 ) = ∑( 2 , 3 , 6 , 7 )= ̅ + + ̅ + (, , ) = ( ̅ + ) + ( ̅ + ) = + = . b) For the following Truth table: (6 pts) Provide the Boolean function using the Canonical Sum of Products (SOP), and Product of Sums (POS). Express the Boolean function using the minterms and maxterms representations. Sketch the logic circuit as Canonical Sum of Products and Product of Sums. Sum of Products: = + + ̅ + ̅ + Product of Sums: = ( + + )( + + )( ++ ̅ ) Minterms and Maxterms: = ∑( 1 , 3 , 4 , 6 , 7 ) = ∏( 0 , 2 , 5 ) x y z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 f 0 1 0 1 1 0 1 1 X f Y Z X f Y Z

ELECTRICAL AND COMPUTER ENGINEERING …llamocca/Courses/W17_ECE378/Solutions... · ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design

Embed Size (px)

Citation preview

Page 1: ELECTRICAL AND COMPUTER ENGINEERING …llamocca/Courses/W17_ECE378/Solutions... · ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter 2017

1 Instructor: Daniel Llamocca

Solutions - Homework 1 (Due date: January 24th @ 5:30 pm)

Presentation and clarity are very important!

PROBLEM 1 (25 PTS) a) Simplify the following functions using ONLY Boolean Algebra Theorems. For each resulting simplified function, sketch the

logic circuit using AND, OR, XOR, and NOT gates. (9 pts)

𝐹 = 𝐴(𝐶 + �̅�) + �̅� 𝐹 = (𝑌 + 𝑍)(�̅� + 𝑋) 𝐹(𝑋, 𝑌, 𝑍) = ∏(𝑀0, 𝑀1, 𝑀4, 𝑀5)

𝐹 = 𝐴(𝐶 + �̅�) + �̅� = (�̅� + 𝐶 + �̅�)(�̅� + 𝐴) = �̅� + 𝐶 + �̅�

𝐹 = (𝑌 + 𝑍)(�̅� + 𝑋) = 𝑌𝑋 + �̅�𝑍

𝐹(𝑋, 𝑌, 𝑍) = ∏(𝑀0, 𝑀1, 𝑀4, 𝑀5) = ∑(𝑚2, 𝑚3, 𝑚6, 𝑚7) = �̅�𝑌�̅� + �̅�𝑌𝑍 + 𝑋𝑌�̅� + 𝑋𝑌𝑍

𝐹(𝑋, 𝑌, 𝑍) = �̅�𝑌(�̅� + 𝑍) + 𝑋𝑌(�̅� + 𝑍) = �̅�𝑌 + 𝑋𝑌 = 𝑌.

b) For the following Truth table: (6 pts) Provide the Boolean function using the Canonical Sum of Products (SOP), and Product of Sums (POS). Express the Boolean function using the minterms and maxterms representations. Sketch the logic circuit as Canonical Sum of Products and Product of Sums.

Sum of Products: 𝑓 = �̅��̅�𝑍 + �̅�𝑌𝑍 + 𝑋�̅��̅� + 𝑋𝑌�̅� + 𝑋𝑌𝑍

Product of Sums: 𝑓 = (𝑋 + 𝑌 + 𝑍)(𝑋 + �̅� + 𝑍)(�̅� + 𝑌 + �̅�)

Minterms and Maxterms: 𝑓 = ∑(𝑚1, 𝑚3, 𝑚4, 𝑚6, 𝑚7) = ∏(𝑀0, 𝑀2, 𝑀5)

x y z

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

f

0

1

0

1

1

0

1

1

X

f

Y Z X

f

Y Z

Page 2: ELECTRICAL AND COMPUTER ENGINEERING …llamocca/Courses/W17_ECE378/Solutions... · ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter 2017

2 Instructor: Daniel Llamocca

c) Complete the truth table for a circuit (active high inputs, active high outputs) that activates an output (f=’1’) when the decimal value of the 4 inputs is equal to 0, 3, 5, 6, 9, 12, or 13. Then, simplify the function using Karnaugh maps. (10 pts)

𝑓 = �̅��̅�𝑐̅�̅� + �̅��̅�𝑐𝑑 + �̅�𝑏𝑐�̅� + 𝑎𝑏𝑐̅ + 𝑎𝑐̅𝑑 + 𝑏𝑐̅𝑑 = �̅��̅�(𝑐𝑑̅̅ ̅̅ ̅̅ ) + �̅�𝑏𝑐�̅� + 𝑎𝑏𝑐̅ + 𝑐̅𝑑(𝑎 + 𝑏)

PROBLEM 2 (15 PTS) a) Complete the timing diagram of the logic circuit whose VHDL description is shown below: (5 pts)

library ieee;

use ieee.std_logic_1164.all;

entity circ is

port ( a, b, c: in std_logic;

f: out std_logic);

end circ;

architecture st of circ is

signal x, y: std_logic;

begin

x <= a and b;

y <= x nand c;

f <= y xor (not b);

end st;

b) The following is the timing diagram of a logic circuit with 3 inputs. Sketch the logic circuit that generates this waveform.

Then, complete the VHDL code. (10 pts)

library ieee;

use ieee.std_logic_1164.all;

entity circ is

port ( a, b, c: in std_logic;

f: out std_logic);

end circ;

architecture st of circ is

signal x, y, z: std_logic;

begin

x <= not(a) and b;

y <= c and b;

z <= a and not(b) and not(c);

f <= x or y or z;

end st;

a

f

b

c

a

b

c

d

f

?

a

f

b

y

c

a b c d

0 0 0 0

0 0 0 1

0 0 1 0

0 0 1 1

0 1 0 0

0 1 0 1

0 1 1 0

0 1 1 1

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1

1 1 1 0

1 1 1 1

f

1

0

0

1

0

1

1

0

0

1

0

0

1

1

0

0

1 0

0 1

cd

ab

a b

00

00 01

1 0

1 1

11 10

a b a b a b

a a

bb b

1 0

0 1

0 0

0 0

01

11

10

c d

c d

c d

c d

c

c

d

d

d

Page 3: ELECTRICAL AND COMPUTER ENGINEERING …llamocca/Courses/W17_ECE378/Solutions... · ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter 2017

3 Instructor: Daniel Llamocca

PROBLEM 3 ( 10 PTS) For the following 4-bit bidirectional port, complete the timing diagram (signals 𝐷𝑂 and 𝐷𝐴𝑇𝐴):

PROBLEM 4 (10 PTS) A 24-bit address line in a processor handles up to 224 = 16 𝑀𝐵 of addresses, each address containing one-

byte of information. We want to connect four 4MB memory chips to the processor.

Sketch the circuit that: i) addresses the memory chips, and ii) enables only one memory chip (via CE: chip

enable) when the address falls in the corresponding range. Example: if 𝑎𝑑𝑑𝑟𝑒𝑠𝑠 = 0𝑥5𝐹𝐹𝐹𝐹𝐹, only memory

chip 2 is enabled (CE=1). If 𝑎𝑑𝑑𝑟𝑒𝑠𝑠 = 0𝑥𝐷00𝐹𝐴0, only memory chip 4 is enabled.

Complete the number of bits ‘??’ required for each 4MB memory chip.

010

a b c

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

f

0

0

1

1

1

0

0

1

c

ab

0

1

00 01 11 10

0 1 0 1

1

a

f

b

c

+

000000

3FFFFF

400000

7FFFFF

800000

BFFFFF

C00000

FFFFFF

......

......4MB

4MB

4MB

4MB

4 MB

CE

4 MB

CE

4 MB

CE

4 MB

CE

Memory

space

Memory

devices

1 2 3 41

2

3

4 24address

22 22 22 22

w0w1

y0y1y2y3

address(21..0)

address(22)

address(23)

10011010

4

OE

DI DATA4

DATA

OE

DO

DI

1100

0111 1010 1001

DO

0101

00100111 1010 1001 0101

1100 1010 1001 0010

Page 4: ELECTRICAL AND COMPUTER ENGINEERING …llamocca/Courses/W17_ECE378/Solutions... · ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter 2017

4 Instructor: Daniel Llamocca

PROBLEM 5 (15 PTS) Complete the timing diagram of the circuit shown below:

PROBLEM 6 (15 PTS) In these problems, you MUST show your conversion procedure.

a) Convert the following unsigned integer numbers to their binary and hexadecimal representation. (4 pts)

- 124 = (1111100)2 = 0𝑥7𝐶

- 115 = (1110011)2 = 0𝑥73 - 128 = (10000000)2 = 0𝑥80

- 255 = (11111111)2 = 0𝑥𝐹𝐹

b) What is the minimum number of bits required to represent: (3 pts) 50,000 colors? ⌈𝑙𝑜𝑔250000⌉ = 16 𝑏𝑖𝑡𝑠

32679 symbols? ⌈𝑙𝑜𝑔232679⌉ = 15 𝑏𝑖𝑡𝑠

65536 memory addresses in a computer? ⌈𝑙𝑜𝑔265536⌉ = 16 𝑏𝑖𝑡𝑠

c) A microprocessor can handle addresses from 0x0000 to 0x1FFF. How many bits do we need to represent those

addresses? (2 pts).

The range from 0x0000 to 0x1FFF is akin to all the possible cases with 13 bits. So, we need 13 bits.

d) Complete the following table. (6 pts)

Decimal BCD Binary number Reflective Gray Code 128 0001 0010 1000 10000000 11000000

171 0001 0111 0001 10101011 11111110

49 0100 1001 110001 101001

241 0010 0100 0001 11110001 10001001

114 0001 0001 0100 1110010 1001011

631 0110 0011 0001 1001110111 1101001100

y

P3

f

w

E

P2

P1

P0

10 11 01 01 11 01 00 10

3

2

1

0

DECODER

w

E

y3

2

PRIORITYENCODER

P3x1

x0

P2

P1z

y2

y1

y0

s1s0

P0 f

Unknown

x 11 00 01 00 11 00 10

z

0100 1000 0000 0010 1000 0010 0001 0100

k

k

00

0 0000 0000 0000: 0x0000

0 0000 0000 0001: 0x0001

...

...

...

1 1111 1111 1111: 0x1FFF

Page 5: ELECTRICAL AND COMPUTER ENGINEERING …llamocca/Courses/W17_ECE378/Solutions... · ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter 2017

5 Instructor: Daniel Llamocca

PROBLEM 7 (10 PTS) Complete the timing diagram of the digital circuit shown in the figure below. You must consider the propagation delays.

Assume that the propagation delay of every gate is 5 ns. The initial values of the signals are specified in the figure.

a

f

na

p

q

1

0

0

0

5 ns

0

p

a

na

q

f