CS 147                     Assignments:      Quiz #4 Answers

Homework:


Programs: 
Program #1

Quizzes:
Quiz #3
Quiz #4

 

 

1.  Convert the following circuit into a circuit consisting of NAND and NOT gates only.

 

      ____     
      \   \
A  ---|    \____    
B  ---|    /    |    ____       ____
      /___/     |___|    \     |    \
                    |    |O----|    |
C  -----------------|    |     |    |
                    |____/     |    |----
                               |    |
D  ----------------------------|    |
                               |____/

For the first OR gate, we know that a NAND gate is the same thing as an OR gate that has all NOTs as inputs. So we simply change that OR gate into a NAND gate, and not it once again so that it will still be the same output.

For the already present NAND gate, we don’t need to do anything, since it is already a NAND gate.

For the next AND gate, we simply change it into a NAND gate, and not it again so that the output will be the same.

Thus, it now looks like:

 

      ____     
      |   \
A  ---|    |O----    
B  ---|    |    |    ____       ____
      |___/     |_O_|    \     |    \
                    |    |O----|    |
C  -----------------|    |     |    |
                    |____/     |    |O---O----
                               |    |
D  ----------------------------|    |
                               |____/

 

The “O”s that are not a part of a gate are NOTs.

2.      Simplify the following K-map

F(a,b,c,d) = a’bc’d + a’bcd + abc’d’ + abc’d + abcd + abcd’ + ab’cd + ab’cd’

The easiest way to generate the K-map is to change each minterm into binary.

By looking at the equation, we can easily get the binary equivalents:

a'bc'd + a'bcd + abc'd' + abc'd + abcd + abcd' + ab'cd + ab'cd'
0 10 1   0 111   110 0    110 1   1111   1110    10 11   10 10

Then we just place all the 1s in the K-map according to these values, and it will look like:

 

AB\CD

00

01

11

10

00

0

0

0

0

01

0

1

1

0

11

1

1

1

1

01

0

0

1

1

We get 3 implants at:

0101, 0111, 1101, and 1111 = BD

1100, 1101, 1111, and 1101 = AB

1111, 1011, 1110, and 1010 = AC

So F(a,b,c,d) = BD+AB+AC

 

3. This one takes a little time. First we want excitation questions, which are the two Ts. Since we have two of them, it would be easier to call them T0 and T1.

By following the lines, we see that there is Q0 XOR Q1. Then this whole equation is XOR with x. Thus, we have (Q0 XOR Q1) XOR x

This equation leads to T1, and the complement leads to T0.

The line of Y1 is the same as the equation Q0 XOR Q1, and Y0 is simply Q1.

Now we want to create a table in order to get the next states and output. The first things that should be in the table are X, Q0 and Q1, so we can generate T0, T1, Y0, Y1, Q0+ and Q1+, and the output.

REMEMBER that T0 only uses Q0 in order to obtain Q0+ and T1 only uses Q1 to obtain Q1+!!!!!!!!!

As with T, if T is 0, then Q+ will be Q, and if T is 1, Q+ will be Q’.

Thus, the table should look like this: (Remember, T1 is the same as ((Q0 xor Q1) xor x)

 

X

Q0

Q1

Q0 xor

Q1

(Q0 xor Q1)

xor X

 

T0

Y1

Y0

Q0+

Q1+

Y0Y1

0

0

0

0

0

1

0

0

1

0

0

0

0

1

1

1

0

1

1

0

0

1

0

1

0

1

1

0

1

0

1

1

0

0

1

1

0

0

1

0

1

0

1

0

1

0

0

0

1

0

0

0

0

1

0

1

0

1

1

0

1

1

1

1

1

1

1

1

0

1

0

1

1

0

0

0

0

1

1

1

0

1

0

0

1

1

0

0

From this, the present states are simply Q0Q1, and the next states are Q0+Q1+, and the inputs for each state is X, and the outputs of each state is Y0Y1.

Then, we just draw the state diagram with:

00 going to 10 with 0/0

00 going to 01 with 1/0

01 going to 00 with 0/1

01 going to 11 with 1/1

11 going to 01 with 0/0

11 going to 10 with 1/0

10 going to 11 with 0/0

10 going to 00 with 1/0

 

1