Design and Implementation of A 32 Bit RISC Processor On Xilinx FPGA
Design and Implementation of A 32 Bit RISC Processor On Xilinx FPGA
net/publication/4342279
CITATIONS READS
15 873
5 authors, including:
All content following this page was uploaded by Eric Ayeh on 21 May 2014.
A. Control Unit
Our control unit is modeled as finite state machine (FSM) and
has 6 states. In the initial state, nothing happen until the start
button has been pushed. Once pushed, the control unit moves
to the zero state. In that state, an instruction is fetched from
the memory and put into the instruction Figure 5: Control Unit state diagram
register (IR ← Memory[PC ]) . The state is then upgraded
from zero to one. The instruction is then checked by the B. Arithmetic Logic Unit (ALU)
control unit. If a Register Instruction is determined, the PC is
incremented and the actual value in the source register along
An ALU is a digital circuit that calculates arithmetic
with the carry is sent to the ALU ( ALUout = ( SRC ) + C I ) . operations like: addition, subtraction, shifting and exclusive or.
The state is moved from state 1 to 2. If an Input instruction is For our case, the ALU will only be taking care of addition and
detected, the PC is incremented and the input bits are loaded subtraction. It is composed of a 4-bit full adder and a unit
into the register pointed to by the DST used to obtain the 2’complement of numbers for simpler
bits (Re g[ DST ] ← SW Re g ) and then the state goes back subtractions.
to state 0. If the instruction is Halt & Display instruction, the
PC is incremented; the machine halts, and displays the
contents of DST register ( Display ← Re g[ DST ]) . As a
result, the state is once again reset. If the instruction is
Unconditional Branch or Branch on Carry, the PC is
incremented and the address bits in the instruction register
goes to the pc (PC ← IR[0 − 3]) . The state then goes to
Figure 6: ALU structure
zero. The second state is only reached in the occurrence of a
register instruction. Depending on the op-code, the control C. Memory
unit works differently. If the Op-code is “00”, the output of Our memory is a 16-word 8-bit. Each bit of the memory
the ALU goes to the destination register (SRAM cell) in a static RAM has an AND gate, a D-latch, and
(DST ← ALUout ) and the state to zero. On the other a tri-state buffer as shown in Figure 7. When a cell’s SEL_L
hand, if the op code is “01” or “10”, then the output of the input is asserted, the stored data is placed on the cell’s output,
ALU goes back to MUX A, and the value in the destination which is connected to a bit line. When both SEL_L and WR_L
register also goes to the ALU which then adds them for are asserted, the latch is open and a new data bit is stored.
“01” ( ALUout ← ALUout + DST ) and subtracts for SRAM cells are combined in an array with additional control
logic to form a complete statistic RAM for a 16X8 SRAM. As
“10” ( ALUout ← DST − ALUout ) . The control unit then in a simple ROM, a decoder on the address lines selects a
goes to the next state. The third state serves as delay for specific row of SRAM to be accessed at any time. Once the
implementation purpose. Finally, in the fourth state the output row is decided, 8 bits data is written in the 8 SRAM or road 8-
of the ALU goes to the destination bit data to next component. Figure 8 illustrates the whole
register (DST ← ALUout ) and the state is reset. The state RAM.
diagram of our controller is shown in Figure 5.
1010-0011=0111
(10-3=7) Figure 13: Processor simulation
Slices 132(6%)
Bells 351
Frequency 95.364MHz
Figure 10: ALU subtraction operation Minimum period 10.486 ns
Table 3: Synthesis report
VI. CONCLUSION
We have successfully implemented an FPGA-based 8-bit
processor on Xilinx Spartan 3 board using the VHDL
language. Our processor is made of the control unit, and an
arithmetic logic unit (ALU) and a memory unit. Our processor
has a maximum frequency of 95.364 MHz and 132 slices were
utilized.
VII. ACKNOWLEDGEMENTS
The authors gratefully acknowledge the support provided by
National Science Foundation (NSF) grant number NSF –
0431818 “A Design- and Project- Oriented Innovative
Electrical Engineering Program”.
VIII. REFERENCES
[1] V. S. Balakrishnan, H. Pottinger, F. Ercal, and M.
Agarwal, Design and implementation of an FPGA based
processor for compressed images (poster abstract). In
Proceedings of the 2000 ACM/SIGDA Eighth
international Symposium on Field Programmable Gate
Arrays (Monterey, California, United States, February 10
- 11, 2000). FPGA '00. ACM, New York, NY, 218.
[2] R. Fryer, FPGA based CPU instrumentation for hard real-
time embedded system testing. SIGBED Rev. 2, 2 (Apr.
2005), 39-42.
[3] P. Yiannacouras, Rose, J., and Steffan, J. G. 2005. The
microarchitecture of FPGA-based soft processors. In
Proceedings of the 2005 international Conference on
Compilers, Architectures and Synthesis For Embedded
Systems (San Francisco, California, USA, September 24 -
27, 2005). CASES '05. ACM, New York, NY, 202-212.
[4] G. Achery, C. Trinitis, R. Buchty, "CPU-independent
assembler in an FPGA," Field Programmable Logic and
Applications, 2005. International Conference , vol., no.,
pp. 519-522, 24-26 Aug. 2005
[5] F. Mayer-Lindenberg, V. Beller, “An FPGA-based
floating-point processor array supporting a high-precision
dot product” Field Programmable Technology, 2006.
FPT 2006. IEEE International Conference on Dec. 2006
Pages: 317 – 320.
[6] Y Nagaonkar and M. L. Manwaring. “An FPGA-based
Experiment Platform for Hardware-Software Codesign
and Hardware Emulation” In proceedings of The 2006
World Congress in Computer Science, Computer
Engineering, and Applied Computing Pages: 169-174.
[7] D. Chiou, H. Sanjeliwala, D. Sunwoo, J. Z. Xu, and N.
Patil, "FPGA-based Fast, Cycle-Accurate, Full-System
Simulators," in Proceedings of the second Workshop on
Architecture Research using FPGA Platforms, held in
conjunction with HPCA-12, Austin, TX, Feb. 2006.