
The ALU8 Serial is an 8-bit Arithmetic Logic Unit that processes two operands (A and B) shifted in serially. It supports eight different operations and provides parallel output for the result and status flags.
op[2:0]) and the initial Carry_in from the input pins.Bit_in pin.Bit_in pin.Done signal goes high, and the 8-bit result is presented on the uo_out pins. Status flags (Carry, Zero, Negative, Overflow) are updated on the bidirectional uio pins.000: ADD (A + B + Carry_in)001: SUB (A - B - Carry_in)010: AND (A & B)011: OR (A | B)100: XOR (A ^ B)101: NOT (~A)110: SHL (A << 1, MSB to Carry)111: SHR (A >> 1, LSB to Carry)To test the ALU, you can follow these steps:
rst_n low to initialize the internal state.ui_in[3:1] and Carry_in on ui_in[4].ui_in[0], pulsed by clk.ui_in[0], pulsed by clk.uio_out[4] (Done). If high, the result is valid on uo_out[7:0] and flags are on uio_out[3:0].No specific external hardware is required. The design can be interfaced with:
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Bit_in (serial data input, LSB-first) | Data_out[0] | Carry_out |
| 1 | op[0] | Data_out[1] | Zero |
| 2 | op[1] | Data_out[2] | Negative |
| 3 | op[2] | Data_out[3] | Overflow |
| 4 | Carry_in | Data_out[4] | Done |
| 5 | Data_out[5] | ||
| 6 | Data_out[6] | ||
| 7 | Data_out[7] |