Referring the the Chapter Review Problems in Brookshear on pp. 70-72:
1. Do the following problems from these pages:
1b, 1c, 2b, 2c, 3b, 3c, 13, 16.
1b.2. Extra Credit: Read ahead about binary numbers. You will see that with 3 bits we can represent the decimal numbers 0 through 7, as the following table shows:
Input to or is 1 and 0, so it outputs 1
thus, input to and is 1 and 0, so it outputs 0
Answer: 01c.
Input to left xor is 1 and 0, so it outputs 1
thus, input to right xor is 1 and 1, so it outputs 0
Answer: 02b.
A 0 on the lower input makes the and 0 regardless of the value of the upper input, thus also makes the or 0, too. Thus, we cannot have a 0 on the lower input. A 1 on the lower input, on the other hand, makes the or 1 regardless of the upper input. Thus:
Answer: (1 upper and 1 lower) or (0 upper and 1 lower)2c.
For the and to be 1, the output of the not must be 1, thus the lower input (the input to the not) must be 0. What's more, also for the and to be 1, the output of the xor must be 1, which requires (given that the lower input is 0) that the upper input be 1. Thus:
Answer: 1 upper and 0 lower3b.
Check each gate type in succession:
And: (0 and 1) and 1 = 0 and 1 = 0 (no good)
Or: (0 or 1) or 1 = 1 or 1 = 1 (good)
Xor: (0 xor 1) xor 1 = 1 xor 1 = 0 (no good)
Thus:
Answer: Or3c.
Check each gate type in succession:
And: (1 and 1) and (1 and 1) = 1 and 1 = 1 (no good)
Or: (1 or 1) or (1 or 1) = 1 or 1 = 1 (no good)
Xor: (1 xor 1) xor (1 xor 1) = 0 xor 0 = 0 (good)
Thus:
Answer: Xor13. There are multiple ways to approach this problem, and any reasonable and properly-defended answer will receive full credit. If you use a simple text editor, such as Notepad or an email editor, then each character takes one byte, and you typically get somewhere around 50 lines of 60 characters per page, or 3000 bytes (written 3KB, for 3 "Kilobytes", which is about 3000 bytes) per page. Thus, 40 pages would be about 120KB, which is less than 1/10th of the 1.44MB on a floppy. No worries.
However, you can also consider the size of a Word document. A typical page saved in this case, due to the vast overhead that Word introduces in the file, is about 30k. Thus, 40 pages would be about 1200KB, or 1.2MB, which is getting dangerously close to the 1.44MB on a floppy. Given that we are only approximating here, there is enough reason to conclude that anyone writing a 40+ page document in Word should plan on saving it somewhere besides a floppy.
16. With 3500 characters per page, and one byte per character, and 400 pages, we would need 400 * 3500 = 140,000 bytes = roughly 140KB. This is about 1/10th of a 1.44MB floppy disk.
| x | y | z | 3-bit binary number (xyz) | Decimal equivalent |
| 0 | 0 | 0 | 000 | 0 |
| 0 | 0 | 1 | 001 | 1 |
| 0 | 1 | 0 | 010 | 2 |
| 0 | 1 | 1 | 011 | 3 |
| 1 | 0 | 0 | 100 | 4 |
| 1 | 0 | 1 | 101 | 5 |
| 1 | 1 | 0 | 110 | 6 |
| 1 | 1 | 1 | 111 | 7 |
Your task is to write a circuit which checks for prime numbers. That is, your circuit should take 3 inputs -- x, y, and z -- which represent the 3-bit binary number xyz in the table above, and it should produce one output which is true if that number is prime (that is, if its decimal equivalent is 2, or 3, or 5, or 7).
Look at the bold rows (the prime numbers) in the table. There are four of them. Notice that the top two are described by ~x and y. Also, the bottom two are described by x and z. Since we want a function that is true for any of these rows, we just or these two expressions together, to get: (~x and y) or (x and z). You should write down a truth table to prove this to yourself. Note that we will also review this circuit in our Circuit Design Lab this week.See Course Home Page.