You are on page 1of 13

CSC-205 Computer Organization

Test #2
With Answers

Name

1 July 2015

1. Show that x = xy + xy

A. Using truth tables

B. Using Boolean identities

=>
x y F
0 0 0
0 1 0
1 0 1
1 1 1

x = xy + xy
x = x(y + y)
x = x(1)
x=x
(1)

Based on Exercise 9 on page 113.

1
2. Is the following distributive law valid or invalid? Prove your answer.

x ⊕ (yz) = (x ⊕ y)(x ⊕ z)

=> The “law” is invalid.


z y x yz x⊕yz x⊕y x⊕z (x ⊕ y) (x ⊕ z)
0 0 0 0 0 0 0 0
0 0 1 0 1 1 1 1
0 1 0 0 0 1 0 0
0 1 1 0 1 0 1 0
1 0 0 0 0 0 1 0
1 0 1 0 1 1 0 0
1 1 0 1 1 1 1 1
1 1 1 1 0 0 0 0
Based on Exercise 8 on page 113.

2
3. Use any method to prove the following either true or false:

yz + xyz + xyz = xy + xz

=>

yz + xyz + xyz = xy + xz
yz(x + x) + xyz + xyz = xy(z + z) + xz(y + y)
xyz + xyz + xyz + xyz = xyz + xyz + xyz + xyz
xyz + xyz + xyz + xyz = xyz + xyz + xyz + xyz
(2)

They are the same.


Based on Exercise 16 on page 114.

3
4. The truth table for a Boolean expression is shown below. Write the
Boolean expression in sum-of-products form.

x y z F
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0

=> F (x, y, z) = xyz + xyz + xyz + xyz + xyz


Based on Exercise 20 on page 114.

4
5. Tyrone Shoelaces has invested a huge amount of money into the stock
market and doesnt trust just anyone to give him buying and selling
information. Before he will buy a certain stock, he must get input from three
sources. His first source is Pain Webster, a famous stock broker. His second
source is Meg A. Cash, a self-made millionaire in the stock market, and his
third source is Madame LaZora, a world-famous psychic. After several months
of receiving advice from all three, he has come to the following conclusions:

• Buy if Pain and Meg both say yes and the psychic says no.

• Buy if the psychic says yes.

• Don’t buy otherwise.

Construct a truth table and find the minimized Boolean function to implement
the logic telling Tyrone when to buy. =>

Pain Meg Psych. Buy


0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

F (P ain, M eg, P sych) = P ainM egP sych + P ainM egP sych +


P ainM egP sych + P ainM egP sych + P ainM egP sych

Meg & Psych


00 01 11 10
0 1 1
Pain
1 1 1 1

F (P ain, M eg, P sych) = P sych + P ainM eg


Based on Exercise 45 on page 118.

5
6. Create the Kmaps and then simplify for the following functions:

• F (w, x, y, z) = wxyz + wxyz + wxyz + wxyz + wxyz + wxyz + wxyz

• F (w, x, y, z) = wxyz + wxyz + wxyz + wxyz + wxyz

=>
yz
00 01 11 10
00 1 1
01 1 1 1
wx
11
10 1 1
F (w, x, y, z) = x + wxz + wyz

yz
00 01 11 10
00 1 1
01
wx
11
10 1 1 1
F (w, x, y, z) = xy + wxz

Based on Exercise 4 on page 135.

6
7. What does the following machine code do?? And what is the output.

Address Machine language


0000 0100 1001 0000 0000 0000 1101
0003 0100 1001 0000 0000 0000 1110
0006 0101 0001 0000 0000 0000 1110
0009 0101 0001 0000 0000 0000 1101
000C 0000 0000

=> Reads two characters from input (console or file). Prints the two
characters out in reverse order. Based on page 179.

7
8. Determine the output of the following Pep/8 machine-language program.
The left column is the memory address of the first byte on the line:

Mem Machine language


0000 51000A
0003 51000B
0006 51000C
0009 00
000A 4F44
000C 55

=> ODU based on question 7 on page 190

8
1 Necessary tables
References
[1] Linda Null and Julia Lobur, The Essentials of Computer Organization and
Architecture, Jones & Bartlett Publishers, 2010.

[2] J. Stanley Warford, Computer systems, Jones & Bartlett Publishers, 2010.

9
Figure 1: Pep/8 Machine codes from [2].

10
Figure 2: Pep/8 addressing modes from [2].

11
Figure 3: The ASCII table.

12
Figure 4: Boolean identities from [1].

13

You might also like