A VHDL implementation of a minimal microcontroller subsystem composed of an Instruction Register (RI) and a Sequencer.
The system contains two main subsystems:
- Instruction Register (RI) – receives a 12-bit instruction from memory and extracts the operation code and the addresses of two operands.
- Sequencer – controls the instruction register and the Arithmetic Logic Unit (ALU) through a finite state machine.
A structural architecture connects both subsystems.
The 12-bit DataMem input is divided into three 4-bit fields:
┌────────────┬────────────┬────────────┐
│ CodeOp │ Op1 │ Op2 │
│ 11 downto 8│ 7 downto 4│ 3 downto 0 │
└────────────┴────────────┴────────────┘
When ERI = '1' on the rising edge of the clock:
CodeOperationreceivesDataMem(11 downto 8)Operande1receivesDataMem(7 downto 4)Operande2receivesDataMem(3 downto 0)
The sequencer is implemented as a finite state machine with three states:
initfetchexecute
Main control signals:
MemR– indicates that memory data is availableOpDone– indicates that the current ALU operation is completeCRI– controls the Instruction RegisterCUAL– controls the ALU
src/structurelle.vhd connects the Instruction Register and Sequencer.
┌─────────────────────┐
DataMem ─────►│ Instruction Register│
H ───────────►│ (RI) │
└──────────┬──────────┘
│
Operande1 │ Operande2
CodeOperation
│
┌──────────▼──────────┐
MemDone ─────►│ Sequencer │──────► exeUAL
UALDone ─────►│ │
H ───────────►│ │
└─────────────────────┘
The project can be simulated with a VHDL-compatible simulator such as:
- ModelSim / Questa
- Vivado
- GHDL
- VHDL entity and architecture design
- Instruction register implementation
- Bit-vector slicing
- Finite State Machines
- Synchronous clocked processes
- Component instantiation
- Structural VHDL design
- Digital microcontroller architecture