This is a simple RISC 32 bit processor made using Verilog. This is based on the idea provided by dr.Smruti ranjan sarangi sir(IIT Delhi,Computer organisation and Architecture).
- This is Single cycle processor.
- It has five stages mainly,
- Instruction Fetch (IF)
- Operand Fetch (OF)
- Execute (EX)
- Memory Access (MA)
- Writeback (WB)
- It has 4KB of Random access memory.
- Memory is 8 bits wide but processor access 32 bits (4B) for Operation.
- It has 16 Registers.
- Out of those 14 (R0,R1....R13) are General purpose Register.
- R14 (Stack Pointer) and R15 (Return Address Register) are Special purpose register.
- Each Register is 32 bit wide and clock edge triggered.
- It has total 21 Instruction.
- out of which 13 are Arithmetic instructions and remaining are branch,load-store,call instruction. Arithmetc Instructions:
- add
- sub
- mul
- div
- mod
- cmp
- and
- or
- not
- mov
- lsl
- lsr
- asr
Others:
- nop
- ld
- st
- beq
- bgt
- b
- call
- ret
sample program: //FACTORIAL of n
.text
mov r0,5 # Given Number in R0.
mov r1,1 # Factorial of the number will be stored in R1.
.loop1:
mul r1,r1,r0
sub r0,r0,1
cmp r0,1
beq .EXIT
b .loop1
.EXIT:
- The assembly program has to be written in "program.asm" file in assembly language.
- The Hex file is "Input_Memory" which is read by the processor.
- The output i.e. Updated register file and updated memory is stored in "Updated_Memory" file.
- The simulation time can be varied from the test processor file.