程序代写代做代考 Intro to Computer Systems :: ALU Worksheet

Intro to Computer Systems :: ALU Worksheet
The characteristics of binary numbers in the two¡¯s complement system coupled with a combination of four simple binary/Boolean operations (zeroing, bitwise negation, adding, anding) provides us with at least eighteen simple arithmetic functions.
ALU Truth Table
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).
Example:
ALU input x y
f(x,y)=0 result will be 0000
1010 xis-6
0001 y is 1
zx=1 set x to zero
0000
nx=0 don’t negate x
0000
zy=1 set y to zero
0000
ny=0 don¡¯t negate y
0000
f=1 add x and y
0000
no=0 don¡¯t negate result
0000

Intro to Computer Systems :: ALU Worksheet
ALU input x y
f(x,y)=1 result will be 0001
0111 x is 7
0010 y is 2
zx=1
nx=1
zy=1
ny=1
f=1
no=1
f(x,y)=-1
1010
0001
zx=1
nx=1
zy=1
ny=0
f=1
no=0
f(x,y)=x
0010
0101
zx=0
nx=0
zy=1
ny=1
f=0
no=0
f(x,y)=y
1010
0011
zx=1
nx=1
zy=0
ny=0
f=0
no=0
f(x,y)=!x
1010
0011
zx=0
nx=0
zy=1
ny=1
f=0
no=1

Intro to Computer Systems :: ALU Worksheet
f(x,y)=!y
1010
0101
zx=1
nx=1
zy=0
ny=0
f=0
no=1
f(x,y)=-x
0010
1000
zx=0
nx=0
zy=1
ny=1
f=1
no=1
f(x,y)=-y
1010
0001
zx=1
nx=1
zy=0
ny=0
f=1
no=1
f(x,y)=x+1
0001
0001
zx=0
nx=1
zy=1
ny=1
f=1
no=1
f(x,y)=y+1
1010
1111
zx=1
nx=1
zy=0
ny=1
f=1
no=1

Intro to Computer Systems :: ALU Worksheet
f(x,y)=x-1
0110
0001
zx=0
nx=0
zy=1
ny=1
f=1
no=0
f(x,y)=y-1
0001
1111
zx=1
nx=1
zy=0
ny=0
f=1
no=0
f(x,y)=x+y
0010
0101
zx=0
nx=0
zy=0
ny=0
f=1
no=0
f(x,y)=x-y
0111
0010
zx=0
nx=1
zy=0
ny=0
f=1
no=1
f(x,y)=y-x
1101
1111
zx=0
nx=0
zy=0
ny=1
f=1
no=1

Intro to Computer Systems :: ALU Worksheet
f(x,y)=x&y
1011
1000
zx=0
nx=0
zy=0
ny=0
f=0
no=0
f(x,y)=x|y
1111
1010
zx=0
nx=1
zy=0
ny=1
f=0
no=1