Operand A is first entered, followed by operand B and lastly by OpCode. Switches used to enterd the operands and opcode. Center button used transition to the next state. OpCode operators are represented by: '00' means mathematical operator '+', '01' means mathematical operator '-', '10' means logical operator 'AND' and '11' means logical operator 'OR'. Switches represent binary values with most right switch being LSB and most left switch being MSB. OpCode operators are reserved to the first LSB bits and the last two MSB LEDs represent the FSM state that's being entered. The FSM has five states: Operand A, Operand B, Operand O, Operand G and reset. Operand A and B represent the integers, Operand O represnt the OpCode and Operand G represent the output. The seven-segment decoder outputs the state that has been entered after pressing the center button or transitioning to the next FSM state.
The objective of this project is to design an ALU component that can add, subtract, and perform bitwise AND or OR depending on the opcode/operation provided to the ALU. The ALU should have two 8 bit operands anda a 2 bit opcode as inputs and should produce another 8 bit operand that will be saved into a register. The values saved into the input registers or the ALU input operands and the operation code are all supplied by the finite state machine. The fsm first state is the to take in the value of operand A and output it into register A is then fed into the ALU. The second state of the FSM is to save the operand B and output into register B. The FSM operand input values are entered using the switches of the Nexys 4 DDR Artix-7 FPGA board and the state is changed by pressing the central button.
- buttonC
- clk
- opreand A
- operand B
- opcode
- clk
- opreand A
- clk
- enable
- opreand B
- clk
- enable
- opreand G
- clk
- enable
- opreand O
- clk
- enable
- opreand G
- bcd(3 downto 0)
- bcd(7 downto 4)
- bcd(11 downto 8)
- regA, regB, regG, regO
- sel
- clk
- button
- clk
- clk_in
- enable_A, enable_b, enable_C, enable_O
- display_Mode
- result
- opreand A
- opreand B
- opreand G
- opreand O
- BCD code
- bcd(3 downto 0)
- bcd(7 downto 4)
- bcd(11 downto 8)
- led_out
- debounce_out
- clk_out
- Changes the state of the FSM and there are four states in total.