Design of A 16 Bit Risc Processor Using VHDL IJERTV6IS040284 PDF
Design of A 16 Bit Risc Processor Using VHDL IJERTV6IS040284 PDF
Abstract— This paper targets the design and implementation specified in a register (Rt). There is an unconditional jump that
of a 16-bit RISC Processor using VHDL (Very High Speed jumps to a memory address that is calculated by adding the
Integrated Circuit Hardware Description Language). As IC chip current value in the Program Counter and the 8-bit offset
design involves complex computations and intense usage of specified in the instruction. This gives the target branch
resources, by using an HDL we can save resources and time by
address. A similar procedure is followed by the Conditional
implementing it using the software approach. The
implementation strategies have been borrowed from the popular Jumps but the address is calculated beforehand as an optimistic
MIPS architecture to a certain extent. The processor has 16-bit operation and is stored in a special register, so that if the
arithmetic and logical instruction set which has been designed condition is true then the branch target address is written into
and simulated. The instruction set is extremely simple and it gives the Program Counter. If the condition is false then the Program
an insight into the kind of hardware that would be required to Counter will not be modified and execution will continue as if
execute the instructions accordingly. The ALU, instruction no branching took place. There is also a no operation (NOP)
register, program counter, register file, control unit and memory instruction. The complete instruction set is given in Table I.
have been integrated in the proposed processor. All the modules
in the design are coded in VHDL to ease the description, TABLE I. INSTRUCTION SET
verification, simulation and hardware implementation. The
blocks are designed using the behavioral approach. Instruction Opcode Operation
1 ADD 0 0 0 0 Rd = Rs1 + Rs2
Keywords — RISC Processor, MIPS, SPU, ALU, ISA, VHDL, 0 0 0 1 If RS1 > RS2
PC, Opcode, clock, timing, FPGA, instruction, LOAD, JZ, JNZ, 2 SUB Then Rd = RS1 – RS2
ADD, ALB, AGB, waveform, RTL Schematic, 16-bit, Xilinx ISE, Else Rd = RS2 – RS1
3 AND 0 0 1 0 Rd = Rs1 & Rs2
Isim.
4 OR 0 0 1 1 Rd = Rs1 | Rs2
I. INTRODUCTION
5 NOT 0 1 0 0 Rd = ~ Rs
Processors are divided into 3 categories 8-bits, 16-bits
and 32-bits depending upon the demand of performance, cost, 6 XOR 0 1 0 1 Rd = Rs1 ^ Rs2
power and programmability. 16-bit processors have higher If Rs1 = Rs2
performance and power than 8-bit processors and lower power Then Equal = 1, else Equal =0
consumption than 32-bit processors. They are often used in 16- If R1 = 0
bit applications such as disk driver controller, cellular Then AZ = 1, else AZ=0
communication and airbags. A RISC processor uses load-store CMP If Rs2 =0
architecture, fixed length instructions and pipelining. In load- 7 0 1 1 0
(Equal Then BZ =1, else BZ =0
store architecture, load instruction reads data from memory If Rs1> Rs2
and writes it to a register, data-processing instructions process Then AGB = 1, else AGB = 0
data available in registers and write the result to a register and
If Rs1< Rs2
store instruction copies data from register to memory. Then ALB = 1, else ALB = 0
8 SHIFT LEFT 0 1 1 1 Rd=Rs1 <<1
This paper investigates the methodology of soft-core
SHIFT 1 0 0 0
processor development. The software used was Xilinx ISE 9
RIGHT
Rd=Rs1 >>1
14.5. The target family chosen was Spartan 6 FPGA with 1 0 0 1
10 LOAD Rd = Mem[Rs1]
device XC6SLX9 and package CSG324. The simulation was
1 0 1 0
performed in ISim. 11 STORE Mem[Rs1] = Rs2
12 JUMP 1 0 1 1 PC = PC+Offset
II. INSTRUCTION SET
13 NOP 1 1 0 0 No operation
The first step was to design the Instruction Set Architecture
(ISA). The instruction set contains instructions supported by 14 JZ 1 1 0 1 PC = PC+Offset if Rd == 0
the processor. The first nine instructions perform arithmetic 1 1 1 0
15 JNZ PC = PC+Offset if Rd != 1
and logical instructions. The memory read instruction reads the
LOAD 8-BIT 1 1 1 1
data from the memory address which is specified in a register 16
IMMEDIATE
Rd = 8-bit Immediate
(Rs) and writes the data word to the register mentioned in the
instruction (Rd). The memory write instruction writes the data
in the specified register (Rs) to the target address which is also
Opcode Destination Register 8-bit offset (Immediate) There are certain drawbacks of this version of the
(4-bits) Address (4-bits) (Rd) processor. Instructions have to be fed directly to the IR, latency
periods need to be inserted between instructions and it cannot
Fig. 8. Format of LI instruction
interface to memory or perform branching.
IV. ARCHITECTURE
After the instructions and their formats were finalized, the B. SPU Version 2
architecture could finally be developed. The architecture was This version is self-sustaining and can fetch instructions on
developed in stages. The processor was initially simple in its own. The SRAM module acts as memory. No latency
design in stage 1, so it was called simple processing unit or periods are needed. Inspiration was taken from the multi-cycle
SPU for short. But in the further stages, more of the MIPS datapath for this implementation. New components were
instructions, were implemented and in stage 3 all the added to facilitate this such as the Control Unit (CU), Program
instructions were implemented. The stages are described Counter (PC) and some multiplexers. The processor uses
below. several components in a single cycle and the processor uses a
5-state finite state machine to control these components. In
A. SPU Version 1 each state the CU generates the control signals for each module
in the different states. The five states are: START, FETCH,
It is a simple processor. It is simply a test module which DECODE, EXECUTE & WRITEBACK.
cannot be used as a part of any system. There was not much
functionality built into this processor. Only 3 blocks were
implemented:
Fig. 9. SPU Version 1 architecture There were no proper means to write instructions to
memory as no user interface was created and there was no
Instruction Register (IR) means for branching, but it successfully performed arithmetic
The ISA is uniform as bit ranges of instructions are shared. and logical instructions at a good speed. A VHDL testbench
The decoder takes the bit fields, separates them was created for this processor. A small example program could
accordingly and feeds them to the other units it is be typed into the SRAM module and for simulation of the
connected to. testbench.
VI. CONCLUSION
Fig. 18. Waveform of JZ instruction
A 16-bit RISC processor has been realized. It can execute
an instruction set with 16 instructions of different classes like
STORE – Memory Write
arithmetic and logical, jumping - both conditional and
The STORE instruction writes the data in a register to a
unconditional jumps and memory interface instructions. The
given memory location. It takes 5 cycles to execute. Here the
simulation output is compared with the expected results and
instruction is xA054. It writes the data stored in register 4 to
the functionality is found correct.
the memory address stored in register 5. The processor goes
through the MEM_ADDRESS and MEM_ACCESS states
The design can be improved in several ways to make it
before finally performing the write. Waveform is shown in
more sophisticated. A user interface can be developed so that
Figure 19.
a user can enter programs and write them to memory which
will then be fetched for execution.
ACKNOWLEDGMENTS
The authors would like to thank their project guide, Prof.
Madhura Shirodkar. Her insight and vision have made it
possible for us to pursue and understand developments in the
areas of Processor Design, VHDL programming and FPGAs.
REFERENCES
[1] Vishwas V. Balpande, Abhishek B. Pande, Meeta J. Walke,
Bhavna D. Choudhari, Kiran R. Bagade, “Design and
Implementation of 16 Bit Processor on FPGA”, IJARCSSE,
January 2015.
[2] Nupur Gupta, Pragati Gupta, Himanshi Bajpai, Richa Singh,
Shilpa Saxena “Analysis of 16 Bit Microprocessor Architecture
on FPGA Using VHDL”, IJAREEIE, April 2014.
[3] V. R. Gaikwad, “Design, Implementation and Testing of 16 bit
RISC Processor”, IOSR-JVSP, March 2013.
[4] Amanjyot Singh Johar, “16 bit Reduced Instruction Set
Computer (RISC) Processor Design A Project Report” ,
Department of Electrical and Computer Engineering, University
of Illinois at Chicago, September 2013.
[5] M.Kishore Kumar, MD.Shabeena Begum, “FPGA Based
Implementation of a 32-bit RISC processor”, IJERA, Setember
2011.
[6] David A. Patterson, David R. Ditzel, “The Case for The
Reduced Instruction Set Computer”.
[7] J.B. Nade, Dr. R. V. Sarwadnya, “The Soft Core Processors : A
Review”, IJIREEICE, December 2015.
[8] Anders Wallander, “A VHDL Implementation of a MIPS” ,
Department of Computer Science and Engineering, Lulea
Teniska Universitet, January 2000
[9] Anjana R, Krunal Gandhi, “VHDL Implementation of a MIPS
RISC Processor”, IJARCSSE, August 2012.
[10] David A. Patterson, John L. Hennessey, Computer Organisation
And Design, Third edition, 2007.