CS 4341 — Digital Logic and Computer Design, Homework 4
5.8(c)
Design the following comparators for 32-bit numbers. Sketch the schematics.
Less than or equal to
We can do this with some simple observations. First subtract the two numbers, then subtract . If the number is negative, return (by checking the most significant bit). If the number is positive, return . The greater than and less than cases are straightforward, and the numbers are equal, then the circuit will give .
Skecthing this, we get:
5.43 Build a 32-bit synchronous Up/Down counter. The inputs are Reset and Up. When Reset is 1, the outputs are all 0. Otherwise, when Up=1, the circuit counts up, and when Up=0, the circuit counts down.
For this, we can utilize the simple ALU discussed in Lecture 23. If Reset is . If Reset is and Up is , , and otherwise . .
After doing the addition, AND Reset with the counter.
This can be sketched as following:
5.44 Design a 32-bit counter that adds 4 at each clock edge. The counter has reset and clock inputs. Upon reset, the counter output is all 0.
The same circuit can be used as in the previous problem, but is always , and the value added is .
Note that this ALU is simply a Full Adder with the Carry Out ignored, since is a fixed value.
5.51 Implement the following functions using a single 16 × 3 ROM. Use dot notation to indicate the ROM contents.
The truth table can simply be copied over.
| D | C | B | A | X | Y | Z |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
5.52 Implement the functions from Exercise 5.51 using a 4 × 8 × 3 PLA. You may use dot notation.
Here, we can simply copy down the boolean formula. To have a 4 x 8 x 3 PLA, we also must reuse the term in for the term in .