This is an implementation of a 16-bit ALU in VHDL.
Name | Purpose | Size |
---|---|---|
R, S | operands | 16-bit integer |
I | operation | 3-bit |
cin | carry-in | 1 bit |
clk | clock | 1 bit |
ce | determines, whether it should be active or not | 1 bit |
Name | Purpose | Size |
---|---|---|
cout | Carry-Flag | 1 bit |
sign | Sign-Flag | 1 bit |
zero | Zero-Flag | 1 bit |
F | result | 16-bit integer |
Code | Operation |
---|---|
000 | R + S |
001 | S - R |
010 | R - S |
011 | R OR S |
100 | R AND S |
101 | (NOT R) AND S |
110 | R XOR S |
111 | R XNOR S |