ALU

x (dec): x (bin): y (dec): y (bin):
ALU input x: ALU input y:
x AND y: x + y:
output (bin): output (dec): zr: ng:
 zx nx zy ny  f no    out          Binary             Decimal
  1  0  1  0  1  0      0                   ...         ...       Komplementit 
  1  1  1  1  1  1      1      0000000000000111          +7       kahden    yhden
  1  1  1  0  1  0     -1      0000000000000110          +6           1 
  0  0  1  1  0  0      x      0000000000000101          +5         1001     1000    (-7)     
  1  1  0  0  0  0      y      0000000000000100          +4        +0101    +0101   +(+5)
  0  0  1  1  0  1     !x      0000000000000011          +3         1110     1101     -2
  1  1  0  0  0  1     !y      0000000000000010          +2        -   1
  0  0  1  1  1  1     -x      0000000000000001          +1         1101
  1  1  0  0  1  1     -y      0000000000000000          +0
  0  1  1  1  1  1    x+1      1111111111111111          -1           (negatoidaan)
  1  1  0  1  1  1    y+1      1111111111111110          -2         1101 ⇒ 0010 ja -2 ⇒ +2
  0  0  1  1  1  0    x-1      1111111111111101          -3
  1  1  0  0  1  0    y-1      1111111111111100          -4
  0  0  0  0  1  0    x+y      1111111111111011          -5
  0  1  0  0  1  1    x-y      1111111111111010          -6
  0  0  0  1  1  1    y-x      1111111111111001          -7
  0  0  0  0  0  0    x&y      1111111111111000          -8
  0  1  0  1  0  1    x|y                   ...         ...