Functional Description



Overview

We have chosen to implement an 8-bit ALU/Calculator supporting a set of standard arithmetic (two's complement), bitwise, boolean, and shifting capabilities.

Supported Operations

Key:
operation operands cycles opcode (bin/hex)
Two's Complement Arithmetic
addition 2 4 011000/18
subtraction 2 4 011001/19
multiplication 2 12 100000/20
Boolean
identity 1 3 000000/00
nand 2 4 000001/01
nor 2 4 000010/02
xnor 2 4 000011/03
not 1 3 000100/04
and 2 4 000101/05
or 2 4 000110/06
xor 2 4 000111/07
Bitwise
identity 1 3 001000/08
nand 2 4 001001/09
nor 2 4 001010/0A
xnor 2 4 001011/0B
not 1 3 001100/0C
and 2 4 001101/0D
or 2 4 001110/0E
xor 2 4 001111/0F
Shifting
logical right shift 2 4 010000/10
arithmetic right shift 2 4 010001/11
rotate right 2 4 010010/12
logical left shift 2 4 010100/14
rotate left 2 4 010110/16

The opcodes are selected to easily enable and control the operation of the major blocks without decode-logic. For example, OP4 enables the arithmetic block, and OP0 selects between addition and subtraction.


Block Diagram

The following block diagram shows the basic data flow through the ALU. The output flags are not shown.


Input

An 8-bit bus will receive input calculator-style: opcode on one cycle, operand on the next, etc. Only 6 bits of the opcode will be latched and decoded. A reset signal can be used to return the ALU to a clean initial state and should remain de-asserted during normal operation. A two-phase non-overlapping clock will synchronize events and require less hardware than an edge-triggered single-clock ALU implementation.

Output

An 8-bit output will be used for the results of all operations including multiplication, along with carry, overflow, ready, and error flags.

Basic Layout

The ALU will be composed of four basic blocks: These blocks are explained in further detail elsewhere.

Credits