0% found this document useful (0 votes)
181 views

Alu Worksheet

The document discusses the design of an arithmetic logic unit (ALU) and how it can perform various functions. It explains that the ALU was designed to perform a list of primitive operations by manipulating binary inputs and outputs. Combining four simple binary operations in a two's complement system can yield eighteen functions, though this may not seem possible at first. The document then prompts the reader to prove this by working through examples of each function applied to 4-bit binary numbers.

Uploaded by

Lucas Mezalira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
181 views

Alu Worksheet

The document discusses the design of an arithmetic logic unit (ALU) and how it can perform various functions. It explains that the ALU was designed to perform a list of primitive operations by manipulating binary inputs and outputs. Combining four simple binary operations in a two's complement system can yield eighteen functions, though this may not seem possible at first. The document then prompts the reader to prove this by working through examples of each function applied to 4-bit binary numbers.

Uploaded by

Lucas Mezalira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Note that each of the six control bits instructs the ALU to carry out a certain elementary

operation. Taken together, the combined effects of these operations cause the ALU to
computer a variety of useful functions. Of course, this does not happen miraculously,
its the result of careful design. (Nisan 34)
First we made a list of all the primitive operations that we wanted our computer to be
able to perform (right column in figure 2.6). Next, we used backward reasoning to figure
out how x, y and out can be manipulated in binary fashion in order to carry out the
desired operations. The resulting ALU is simple and elegant. And in the hardware
business simplicity and elegance imply inexpensive and powerful computer systems.
(Nisan 38)

No way! Do you really believe that combining four simple operations in a twos
complement binary system can yield the eighteen functions above?
Prove the table to yourself by procedurally working through the implementations of each
function (applied to 4-bit numbers for simplicity). Write the decimal equivalent of the
arbitrarily provided binary inputs and outputs. Show each step of your work (use the
margin if necessary when summing or anding).

f(x,y) = 0 0000
set x to zero
dont negate x
set y to zero
dont negate y
add x and y
dont negate result

f(x,y) = 1
zx=1
nx=1
zy=1
ny=1
x+y
!out

1010
0000
0000

-6

0001

0000
0000
0000
0000

0001

f(x,y) = -1

0 duh

1010

0001

1010

0001

Prove to yourself that the answers are correct. First calculate the operation by hand
and write the result in binary and decimal. Compare this calculation to the
procedural output.
f(x,y) = x 0100

0100

0101

f(x,y) = y

1010

0011

f(x,y) = !x

1010

0101

Are you remembering to write the decimal values for each of the inputs and the
target answer (upper-left box)?
f(x,y) = !y

1010

0101

f(x,y) = -x

0010

1000

"Computers in the future may weigh no more than 1.5 tons."


- Popular Mechanics, 1949

f(x,y) = -y

1010

0001

f(x,y) = x+1

0001

0001

f(x,y) = y+1

1010

1111

f(x,y) = x-1

0110

0001

"But what...is it good for?"


- Advanced Computing Systems Division of IBM, 1968, commenting on the microchip

f(x,y) = y-1

0001

1111

f(x,y) = x+y

0010

0101

f(x,y) = x-y

0111

0010

Lets go trashing, someone in the back seat said. Theres a C.O. in Astoria. Its cool to be talking in a
kind of hackers code. The word trashing means climbing around in garbage, where you hope to find
computer printouts that list secret passwords and logons. And C.O., as everybody in the Supra knows,
means Central Office. As in New York Telephones Central Office, in Astoria, Queens.
Masters of Deception by Michele Slatalla

f(x,y) = y-x

1101

1111

f(x,y) = x&y

1011

1000

f(x,y) = x|y

1111

1010

My dear creative, emotional, sometimes foolish, opinionated human,


You should now see that the characteristics of binary numbers in the
twos complement system coupled with a combination of four simple
binary/Boolean operations (zeroing, bitwise negation, adding, oring)
provides us with at least eighteen simple arithmetic functions.
true,
Banana Jr. 2000
PS. Now go build your ALU.

Bloom County Babylon by Berke Breathed

You might also like