PHYSICS 202
SPRING 00
LAB 1
Beginning the Arithmetic Logic Unit (ALU)
This semester we may find that a given week's circuitry builds upon the previous weeks'. Therefore you should get into the habit of saving the Electronics Workbench file(s).
Some if not all of this material is in the book!
Part 1. Binary numbers.
As we know, all of the information stored in and processed by a computer is represented in bits (binary digits, 1's and 0's). Why?
Convert the following decimal numbers into binary.
- 76
- 45
- 52
Convert the following binary numbers into decimal.
- 10101010
- 10010101
- 11011011
Part 2. Hexadecimal numbers.
Even moderately sized decimal numbers can be very long strings of binary digits. Hexadecimal (base 16) is another base sometimes used in computer science. Give an example of where you have seen or might see it.
Being a higher base, hexadecimal numbers require fewer digits than their binary counterparts. How much longer are the binary representations?
Hexadecimal is more convenient than decimal for converting to and from binary. Convert the following numbers from binary to hexadecimal.
- 100011001110
- 110010101010
- 000111100111
Convert the following numbers from hexadecimal to binary
- ABC
- F84
- D0E
Part 3. Half adders.
When adding two numbers, the standard approach is to start with the digits in the lowest positional order (for integers this is the 1's place) and add them. This may produce a "carry" which affects the sum to be performed at the next positional order. Hence there will be three digits to add at higher order. But when you have three things to add, you can always add them two at a time. Produce the truth table for adding two binary digits.
A / B / CO / 0 / 0
0 / 1
1 / 0
1 / 1
The above stands for the sum, while the CO stands for the carry-out (the one or zero that is sent on to the next higher order). Using Electronics Workbench build a circuit from logic gates (ANDs, Ors, XORs, etc.) that has such a truth table. Paste a copy of it below.
Such a circuit is called a "half adder." There is a half adder in Electronics Workbench (under the Digital button). It is shown below.
Part 4. Full adders.
Recall there may have been a carry-in, so the sum of inputs A and B have to be added to the carry-in. This can be accomplished with a second half adder. What should we do with the carry-outs of these two individual half adders in order to obtain one carry-out corresponding to adding all three digits? Using two half adders and logical gates, build a "full adder" (a circuit that can add A and B and the carry in Ci). Paste a copy of it below.
There is a full adder in Electronics Workbench (under the Digital button). It is shown below.
Part 5. Add a two-bit word.
Finally, build a circuit that uses two full adders to add two two-bit numbers ("words"). Paste a copy of it below.