SlideShare a Scribd company logo
1 of 5
Download to read offline
IOSR Journal of VLSI and Signal Processing (IOSR-JVSP)
Volume 2, Issue 2 (Mar. – Apr. 2013), PP 01-05
e-ISSN: 2319 – 4200, p-ISSN No. : 2319 – 4197
www.iosrjournals.org
www.iosrjournals.org 1 | Page
Design, Implementation and Testing of 16 bit RISC Processor
V. R. Gaikwad
(Department of Electronics Engineering, Walchand College of Engineering, Sangli, India)
Abstract : Nowadays Embedded Systems have became a part of human life. The most important part of an
embedded system is the embedded processor. The performance of embedded processor determines the
performance of embedded system. An embedded processor is a Reduced Instruction Set Computer (RISC). In
this paper the procedure for designing, implementing and testing a 16 bit RISC processor is presented. This
processor was implemented in XC3S400 Field Programmable Gate Array (FPGA) and tested on XC3S400
FPGA development board. This processor is useful for demonstrating hazards in pipeline and the techniques
used to solve them.
Keywords - Arithmetic and logical unit (ALU), Input output block (IOB), Integrated software environment
(ISE), Look up table (LUT), Very high speed integrated circuit hardware descriptive language (VHDL)
I. INTRODUCTION
A RISC processor uses load-store architecture, fix length instructions and pipelining. In load-store
architecture, load instruction reads data from memory and writes it to a register, data processing instructions
process data available in registers and write result to a register, and store instruction copies data from register to
memory. Pipelining is an implementation technique in which multiple instructions are overlapped in execution
[1]. Pipelining improves performance by increasing instruction throughput. To demonstrate how instructions are
executed in pipelined processor and the problems created by pipelining, a 16 bit RISC processor supporting
eight instructions was designed. The terms byte, half word, word and double are used for 8, 16, 32 and 64 bits
data respectively. In mnemonic for an instruction the alphabets b, h, w and d are used for byte, half word, word
and double respectively.
II. INSTRUCTION SET
The first step in design of a RISC processor is the design of instruction set. An instruction set contains
instructions supported by the processor. Load instruction reads data from memory and writes it to a register. If
the address of memory location is specified in load instruction, the instruction length will exceed the number of
bits used to address memory. An alternative to this is, to write the memory address in a register and specify the
register in the instruction. In addition to this, if an offset is specified in the instruction then an operand at a
known offset from a memory location can be accessed. So, load instruction capable of copying data from the
memory location whose address is sum of base register (Rs) content and offset (Imm) to a destination register
(Rt), was selected. Store instruction capable of copying data from register (Rt) to the memory location whose
address is sum of base register (Rs) and offset (Imm), was selected. Arithmetic and logical instructions process
data present in registers. Both arithmetic and logical operations produce a result after processing two operands.
In two operands arithmetic and logical instructions one of the two source registers is the destination register. If
the destination register is a fixed register then, before performing the next arithmetic or logical operation the
result must be copied to other register. If the destination register isn’t a fixed register then, its content will be
lost after performing arithmetic or logical operation. In three operands arithmetic and logical instructions, the
result is directly written to a register other than or one of the two source registers. So, arithmetic and logical
instructions capable of reading data from two source registers (Rs and Rt) and writing result to destination
register (Rd), was selected. The normal sequence of program execution can be changed by using branch
instruction. An unconditional branch instruction loads program counter (PC) with the value specified in the
instruction. Conditional branch instructions modify PC, if the branch condition is true, by an amount equal to
the offset specified in the instruction. Table 1 lists the instructions supported by this processor.
III. INSTRUCTION FORMAT
The second step is design of instruction format. Each instruction is assigned a unique code, known as
operation code (Opcode). For eight instructions 3 bits opcode field is required. The opcode field can be reduced
to 2 bits by using same opcode for arithmetic and logical instructions and another code, known as function code,
to specify the intended arithmetic or logical operations. For five arithmetic and logical instructions 3 bits
function field is sufficient. Each register, in register file, is assigned a unique address. To address eight registers,
Design, Implementation and Testing of 16 bit RISC Processor
www.iosrjournals.org 2 | Page
3 bits address field is required. The systematic placement of these fields in the instruction is referred to as
instruction format.
For arithmetic and logical instructions, an opcode field, three 3 bits address fields and a function field
is required. The resulting instruction format is known as R format.
For load, store and branch instructions, an opcode field, two 3 bits address fields and an immediate
field is required. The resulting instruction format is known as I format.
Table 1 Instruction Set
Format Opcode Instruction Operation
R
(00)2 add Rd, Rs, Rt Rd  Rs + Rt
(00)2 sub Rd, Rs, Rt Rd  Rs – Rt
(00)2 and Rd, Rs, Rt Rd  Rs & Rt
(00)2 or Rd, Rs, Rt Rd  Rs | Rt
(00)2 slt Rd, Rs, Rt if (Rs < Rt) then Rd  1 else Rd  0
(11)2 beq Rs, Rt, Imm if (Rs = Rt) then PC  PC + 1 + Imm else PC  PC + 1
I
(01)2 lh Rt, Imm(Rs) Rt  Mem[Rs + Imm]
(10)2 sh Rt, Imm(Rs) Mem[Rs + Imm]  Rt
Table 2 Control Signals
Table 3 Truth Table for Control Unit
Opcode RegRd RegWr ALUsrc ALUop Branch MemRd MemWr MemtoReg
(00)2 1 1 0 (10)2 0 0 0 0
(01)2 0 1 1 (00)2 0 1 0 1
(10)2 0 0 1 (00)2 0 0 1 0
(11)2 0 0 0 (01)2 1 0 0 0
IV. DATAPATH AND CONTROL
The third step is design of datapath and control unit. Datapath is a systematic arrangement of hardware
components and their interconnection for performing an operation. The instruction set is divided into two or
more parts with each part containing instructions which require the same logic or hardware for implementation.
In this case the instruction set is divided into three classes, arithmetic and logical, memory reference and branch
opcode (2 bits) rs (3 bits) rt (3 bits) rd (3 bits) unused (2 bits) function (3 bits)
opcode (2 bits) rs (3 bits) rt (3 bits) imm (8 bits)
Control signal Value Function
RegRd
0 Selects rt as destination register address
1 Selects rd as destination register address
RegWr
0 Disables write to register file
1 Enables write to register file
ALUsrc
0 Selects Rt as 2nd
source for ALU
1 Selects Imm as 2nd
source for ALU
ALUop
(00)2 Instruction is load or store
(01)2 Instruction is branch
(10)2 Instruction is arithmetic or logical
Branch
0 Instruction isn’t a branch
1 Instruction is branch
MemRd
0 No memory read operation
1 Memory read operation
MemWr
0 No memory write operation
1 Memory write operation
MemtoReg
0 Selects output of ALU
1 Selects output of Memory
Design, Implementation and Testing of 16 bit RISC Processor
www.iosrjournals.org 3 | Page
instructions. The datapath for each instruction class is designed and combined to get the final datapath. While
combining datapaths a hardware resource is shared by using multiplexer at its input.
Table 4 Truth Table for ALU
IM
Inst
0
1
R
1
PC
NPC
Braddr
PCsrc
Figure 1 Instruction Fetch (IF) Stage
Inst[15:14]
Inst[13:11]
Inst[10:8]
Inst[7:0]
Control
Reg
EQUAL
Sign
Unit
File
Exten
Braddr
Imm16
rtdata
rsdata
Braddr
RegRd
ALUsrc
ALUop
MemWr
MemRd
MemtoReg
RegWr
NPC
Inst
rd
rddata
zflag
Figure 2 Instruction Decode (ID) Stage
ALUout
rsdata
rtdata
Imm16
ALUsrc
0
1
ALU
Imm16[2:0]
Control
Inst[13:11]
Inst[10:8]
RegRd
0
1
rd
ALUop
Figure 3 Execution (EX) Stage
ALUout
rtdata
MemOut
DM
MemRd
MemWr
Figure 4 Memory (MEM) Stage
ALUout
MemOut
MemtoReg
0
1
rddata
Figure 5 Write Back (WB) Stage
ALUop Function field ALU function Operation
(00)2 (XXX)2 (010)2 Addition
(01)2 (XXX)2 (110)2 Subtraction
(10)2 (000)2 (000)2 Bitwise AND
(10)2 (001)2 (001)2 Bitwise OR
(10)2 (010)2 (010)2 Addition
(10)2 (011)2 (110)2 Subtraction
(10)2 (111)2 (011)2 Set on less than
IOSR Journal of VLSI and Signal Processing (IOSR-JVSP)
Volume 2, Issue 2 (Mar. – Apr. 2013), PP 01-05
e-ISSN: 2319 – 4200, p-ISSN No. : 2319 – 4197
www.iosrjournals.org
www.iosrjournals.org 4 | Page
For each instruction to perform the expected operation control signals are required. The control signals
required and the function performed by them is listed in table 2. Control signals are generated by the control unit
according to the opcode of instruction. The value of control signal for each instruction is listed in table 3. The
ALUop control signal and function field in instruction are used to generate ALU function select signal. The
truth table for ALU function select signal is shown in table 4. Depending on the operation performed by each
section of datapath, during execution of an instruction, the datapath can be divided into five stages. The five
stages are, instruction fetch (IF) (Fig. 1), instruction decode (ID) (Fig. 2), execution (EX) (Fig. 3), data memory
access (MEM) (Fig. 4) and write back (WB) (Fig. 5) stage. The operation of each stage was verified by writing
VHDL code and simulating it using ISE simulator [2]-[3]. The propagation delay of each stage, as observed in
Post Route simulation, is listed in table 5.
Table 5 Propagation Delay
Table 6 XC3S400 Device Utilization
Table 7 Sample Code
Figure 6 XC3S400 FPGA Development Board
Figure 7 Serial data received in Hyperterminal
Stage Propagation Delay
IF 13.1 ns
ID 12.5 ns
EX 16.6 ns
MEM 13.6 ns
WB 12.3 ns
Resource Percentage
Number of Slices used 15 %
Number of Slice flip flops used 7 %
Number of 4 input LUT used 10 %
Number of bounded IOB’s used 32 %
Number of GCLK’s used 25 %
Address Instruction Machine code
(0000)2 lh $1, 8($0) (4108)16
(0001)2 sh $1, 9($0) (8109)16
(0010)2 and $0, $0, $0 (0000)16
(0011)2 lh $2, 8($0) (4208)16
(0100)2 sh $2, 9($0) (8209)16
(0101)2 add $3, $1, $2 (0A62)16
(0110)2 sh $3, 9($0) (8309)16
(0111)2 sub $4, $1, $2 (0A83)16
(1000)2 sh $4, 9($0) (8409)16
(1001)2 and $5, $1, $2 (0AA0)16
(1010)2 sh $5, 9($0) (8509)16
(1011)2 slt $6, $5, $4 (2CC7)16
(1100)2 beq $0, $0, -11 (C0F5)16
(1101)2 sh $6, 9($0) (8609)16
Design, Implementation and Testing of 16 bit RISC Processor
www.iosrjournals.org 5 | Page
V. PIPELINING
Pipelining is an implementation technique in which multiple instructions are overlapped in execution.
The datapath is pipelined by inserting a register, known as pipeline register, between two stages. The stage
enclosed between two pipeline registers is known as pipe stage. The PC and pipeline registers are driven by the
same clock and reset signal. For pipelined datapath to work properly, clock with period greater than or equal to
maximum of propagation delays of pipe stages, is required. For this processor, according to table 5, the
minimum clock period is 20 ns. Problems associated with pipelined datapath are referred to as pipeline hazards.
Data dependence between instructions results in data hazards. Data hazards are solved by compiler by inserting
no operation (NOP) instruction between the instruction producing the result and the instruction using it. In
hardware, techniques like forwarding and stalling are used. In data forwarding, the data forwarding logic creates
a path from the location in the pipeline where the required data is available to the location where it is required.
In stalling, the hazard detection logic detects data hazard and stalls the pipeline. In case of branch instructions,
the delay in starting execution of instruction at branch target address, when branch condition is true, results in
control hazards. This delay is reduced by modifying the datapath. VHDL codes for pipelined datapath, pipelined
datapath with forwarding logic, pipelined datapath with forwarding and stalling logic, and pipelined datapath
modified to handle control hazard were written and tested.
VI. TESTING
The processor was implemented in XC3S400 FPGA. The device utilization is presented in table 6. The
XC3S400 development board, from Mechatronics, has 16 input pins, 16 output pins, 4 seven segment LED
displays, RS232 interface, USB interface, VGA interface, ADC and DAC. A memory mapped input port at
address 8, memory mapped output port at address 9, 4 digit multiplexed display controller and serial transmitter
were added to the design. The 4 digit multiplexed display controller was used to display the current instruction
fetched from IM (Fig. 6). The serial transmitter was used to transmit, PC contents, instruction fetched, next PC
calculated, Rs contents, Rt contents, Imm16, ALU output, ALU output bypassed, memory output, end of line
indicator (33), carriage return and line feed, during each clock cycle with 8-N-1 format and 4800 bps. Before
transmitting the 16 bit data, it was divided into four 4 bit data and each 4 bit data was converted from binary to
ASCII. A test code (table 7) containing the instructions supported by the processor was written to IM, to test the
processor. This code contains both data hazard and control hazard. The data obtained in hyperterminal clearly
indicates the activities inside the processor. The data dependency between the first and second instruction and
fourth and fifth instruction stalls the pipeline. Stalls and one clock cycle branch delay are indicated by square in
Fig. 7.
VII. CONCLUSION
This processor is similar to the 32 bit MIPS processor explained in [1] however, this processor uses
word addressing and supports only eight instructions. This processor is useful for demonstrating pipeline
hazards and the techniques used to solve them.
REFERENCES
[1] David A. Patterson and John L. Hennessy, Computer organization and design (Morgan Kaufmann, 1998)
[2] Douglas Perry, VHDL Programming (Tata McGraw Hill)
[3] John Wakerly, Digital design (PHI)
BIBLIOGRAPHY
Mr. V. R. Gaikwad born in Maharashtra, in India on December 29, 1977. He graduated from Dr. J. J.
Magdum College of Engineering, Jaysingpur and post graduated from Walchand College of Engineering,
Sangli. He received B.E and M.Tech. degree in Electronics Engineering from Shivaji University,
Kolhapur. He is working as Assistant Professor in the department of electronics engineering at walchand
college of engineering, sangli. His fields of interest include circuits and systems, embedded systems and
VLSI.

More Related Content

What's hot

Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02Yazeed Khalid
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTUREDr.YNM
 
microprocessor Questions with solution
microprocessor Questions with solutionmicroprocessor Questions with solution
microprocessor Questions with solutiondit
 
Module 3 special purpose programmable devices and their interfacing
Module 3 special purpose programmable devices and their interfacingModule 3 special purpose programmable devices and their interfacing
Module 3 special purpose programmable devices and their interfacingDeepak John
 
Register of 80386
Register of 80386Register of 80386
Register of 80386aviban
 
The sparc architecture (3)
The sparc architecture (3)The sparc architecture (3)
The sparc architecture (3)vishuupra
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-IIIDr.YNM
 
PPT 8085 microprocessor
PPT 8085 microprocessor PPT 8085 microprocessor
PPT 8085 microprocessor Ardhendupanja
 
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionDr. Pankaj Zope
 
MICROPROCESSOR INPUT OUTPUT OPERATIONS
MICROPROCESSOR INPUT OUTPUT OPERATIONSMICROPROCESSOR INPUT OUTPUT OPERATIONS
MICROPROCESSOR INPUT OUTPUT OPERATIONSGeorge Thomas
 
8085 micro processor- notes
8085 micro  processor- notes8085 micro  processor- notes
8085 micro processor- notesDr.YNM
 
Interfacing of data converters & io devices
Interfacing of data converters & io devicesInterfacing of data converters & io devices
Interfacing of data converters & io devicesDr.YNM
 
Clock-8086 bus cycle
Clock-8086 bus cycleClock-8086 bus cycle
Clock-8086 bus cycleRani Rahul
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
15CS44 MP & MC Module 4
15CS44 MP & MC Module 415CS44 MP & MC Module 4
15CS44 MP & MC Module 4RLJIT
 
MICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMSMICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMSSabin Gautam
 

What's hot (20)

Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURE
 
microprocessor Questions with solution
microprocessor Questions with solutionmicroprocessor Questions with solution
microprocessor Questions with solution
 
ARM- Programmer's Model
ARM- Programmer's ModelARM- Programmer's Model
ARM- Programmer's Model
 
Module 3 special purpose programmable devices and their interfacing
Module 3 special purpose programmable devices and their interfacingModule 3 special purpose programmable devices and their interfacing
Module 3 special purpose programmable devices and their interfacing
 
Register of 80386
Register of 80386Register of 80386
Register of 80386
 
The sparc architecture (3)
The sparc architecture (3)The sparc architecture (3)
The sparc architecture (3)
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-III
 
PPT 8085 microprocessor
PPT 8085 microprocessor PPT 8085 microprocessor
PPT 8085 microprocessor
 
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb Instruction
 
MICROPROCESSOR INPUT OUTPUT OPERATIONS
MICROPROCESSOR INPUT OUTPUT OPERATIONSMICROPROCESSOR INPUT OUTPUT OPERATIONS
MICROPROCESSOR INPUT OUTPUT OPERATIONS
 
8085 micro processor- notes
8085 micro  processor- notes8085 micro  processor- notes
8085 micro processor- notes
 
Interfacing of data converters & io devices
Interfacing of data converters & io devicesInterfacing of data converters & io devices
Interfacing of data converters & io devices
 
8085 microprocessor notes
8085 microprocessor notes8085 microprocessor notes
8085 microprocessor notes
 
8085
80858085
8085
 
Clock-8086 bus cycle
Clock-8086 bus cycleClock-8086 bus cycle
Clock-8086 bus cycle
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
microprocessor
   microprocessor   microprocessor
microprocessor
 
15CS44 MP & MC Module 4
15CS44 MP & MC Module 415CS44 MP & MC Module 4
15CS44 MP & MC Module 4
 
MICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMSMICROPROCESSOR 8085 WITH PROGRAMS
MICROPROCESSOR 8085 WITH PROGRAMS
 

Viewers also liked

Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...
Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...
Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...IOSR Journals
 
Classification of News and Research Articles Using Text Pattern Mining
Classification of News and Research Articles Using Text Pattern MiningClassification of News and Research Articles Using Text Pattern Mining
Classification of News and Research Articles Using Text Pattern MiningIOSR Journals
 
High Performance Error Detection with Different Set Cyclic Codes for Memory A...
High Performance Error Detection with Different Set Cyclic Codes for Memory A...High Performance Error Detection with Different Set Cyclic Codes for Memory A...
High Performance Error Detection with Different Set Cyclic Codes for Memory A...IOSR Journals
 
Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...
Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...
Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...IOSR Journals
 
Assessment of Activity Concentration of The Naturally Occurring Radioactive M...
Assessment of Activity Concentration of The Naturally Occurring Radioactive M...Assessment of Activity Concentration of The Naturally Occurring Radioactive M...
Assessment of Activity Concentration of The Naturally Occurring Radioactive M...IOSR Journals
 
Dosimetric evaluation of the MLCs for irregular shaped radiation fields
Dosimetric evaluation of the MLCs for irregular shaped radiation fieldsDosimetric evaluation of the MLCs for irregular shaped radiation fields
Dosimetric evaluation of the MLCs for irregular shaped radiation fieldsIOSR Journals
 
Cloud Information Accountability Frameworks for Data Sharing in Cloud
Cloud Information Accountability Frameworks for Data Sharing in CloudCloud Information Accountability Frameworks for Data Sharing in Cloud
Cloud Information Accountability Frameworks for Data Sharing in CloudIOSR Journals
 
Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...
Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...
Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...IOSR Journals
 
Using Aspect Ratio to Classify Red Blood Images
Using Aspect Ratio to Classify Red Blood ImagesUsing Aspect Ratio to Classify Red Blood Images
Using Aspect Ratio to Classify Red Blood ImagesIOSR Journals
 
Real Time Seismic Monitoring System for Earthquake Using GPS Technology
Real Time Seismic Monitoring System for Earthquake Using GPS TechnologyReal Time Seismic Monitoring System for Earthquake Using GPS Technology
Real Time Seismic Monitoring System for Earthquake Using GPS TechnologyIOSR Journals
 
Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...
Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...
Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...IOSR Journals
 
An Overview of Steganography
An Overview of SteganographyAn Overview of Steganography
An Overview of SteganographyIOSR Journals
 
Spatio-Temporal Database and Its Models: A Review
Spatio-Temporal Database and Its Models: A ReviewSpatio-Temporal Database and Its Models: A Review
Spatio-Temporal Database and Its Models: A ReviewIOSR Journals
 
A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...
A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...
A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...IOSR Journals
 

Viewers also liked (20)

H010613642
H010613642H010613642
H010613642
 
C01230912
C01230912C01230912
C01230912
 
Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...
Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...
Natural Radioactivity of Feed Coal and Its by-products in Barapukuria 2×125 M...
 
Classification of News and Research Articles Using Text Pattern Mining
Classification of News and Research Articles Using Text Pattern MiningClassification of News and Research Articles Using Text Pattern Mining
Classification of News and Research Articles Using Text Pattern Mining
 
High Performance Error Detection with Different Set Cyclic Codes for Memory A...
High Performance Error Detection with Different Set Cyclic Codes for Memory A...High Performance Error Detection with Different Set Cyclic Codes for Memory A...
High Performance Error Detection with Different Set Cyclic Codes for Memory A...
 
Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...
Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...
Evaluation Of Analgesic And Anti Inflammatory Activity Of Siddha Drug Karuvil...
 
D0462530
D0462530D0462530
D0462530
 
Assessment of Activity Concentration of The Naturally Occurring Radioactive M...
Assessment of Activity Concentration of The Naturally Occurring Radioactive M...Assessment of Activity Concentration of The Naturally Occurring Radioactive M...
Assessment of Activity Concentration of The Naturally Occurring Radioactive M...
 
Dosimetric evaluation of the MLCs for irregular shaped radiation fields
Dosimetric evaluation of the MLCs for irregular shaped radiation fieldsDosimetric evaluation of the MLCs for irregular shaped radiation fields
Dosimetric evaluation of the MLCs for irregular shaped radiation fields
 
Cloud Information Accountability Frameworks for Data Sharing in Cloud
Cloud Information Accountability Frameworks for Data Sharing in CloudCloud Information Accountability Frameworks for Data Sharing in Cloud
Cloud Information Accountability Frameworks for Data Sharing in Cloud
 
Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...
Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...
Analysis of Interfacial Microsstructure of Post Weld Heat Treated Dissimilar ...
 
Using Aspect Ratio to Classify Red Blood Images
Using Aspect Ratio to Classify Red Blood ImagesUsing Aspect Ratio to Classify Red Blood Images
Using Aspect Ratio to Classify Red Blood Images
 
Real Time Seismic Monitoring System for Earthquake Using GPS Technology
Real Time Seismic Monitoring System for Earthquake Using GPS TechnologyReal Time Seismic Monitoring System for Earthquake Using GPS Technology
Real Time Seismic Monitoring System for Earthquake Using GPS Technology
 
Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...
Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...
Hardy-Steklov operator on two exponent Lorentz spaces for non-decreasing func...
 
An Overview of Steganography
An Overview of SteganographyAn Overview of Steganography
An Overview of Steganography
 
I010246467
I010246467I010246467
I010246467
 
A0610104
A0610104A0610104
A0610104
 
D0612025
D0612025D0612025
D0612025
 
Spatio-Temporal Database and Its Models: A Review
Spatio-Temporal Database and Its Models: A ReviewSpatio-Temporal Database and Its Models: A Review
Spatio-Temporal Database and Its Models: A Review
 
A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...
A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...
A Comparative Study on Dyeing of Cotton and Silk Fabric Using Madder as a Nat...
 

Similar to A0220105

Design & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining TechniqueDesign & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining TechniqueIOSR Journals
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching materialJohn Williams
 
IMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINEIMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINEijistjournal
 
Unit 4 _ ARM Processors .pptx
Unit 4 _ ARM Processors .pptxUnit 4 _ ARM Processors .pptx
Unit 4 _ ARM Processors .pptxVijayKumar201823
 
Design and simulation of a non pipelined multi cycle 16 bit risc educational ...
Design and simulation of a non pipelined multi cycle 16 bit risc educational ...Design and simulation of a non pipelined multi cycle 16 bit risc educational ...
Design and simulation of a non pipelined multi cycle 16 bit risc educational ...IAEME Publication
 
LPC 2148 Instructions Set.ppt
LPC 2148 Instructions Set.pptLPC 2148 Instructions Set.ppt
LPC 2148 Instructions Set.pptProfBadariNathK
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNBASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNAnonymous Red
 
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic SystemVoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic SystemSagun Man Singh Shrestha
 

Similar to A0220105 (20)

computer organization.pdf
computer organization.pdfcomputer organization.pdf
computer organization.pdf
 
Design & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining TechniqueDesign & Simulation of RISC Processor using Hyper Pipelining Technique
Design & Simulation of RISC Processor using Hyper Pipelining Technique
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
arm-intro.ppt
arm-intro.pptarm-intro.ppt
arm-intro.ppt
 
ARM Introduction
ARM IntroductionARM Introduction
ARM Introduction
 
IMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINEIMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINE
 
Unit 4 _ ARM Processors .pptx
Unit 4 _ ARM Processors .pptxUnit 4 _ ARM Processors .pptx
Unit 4 _ ARM Processors .pptx
 
assignment 1-MC.pdf
assignment 1-MC.pdfassignment 1-MC.pdf
assignment 1-MC.pdf
 
Design and simulation of a non pipelined multi cycle 16 bit risc educational ...
Design and simulation of a non pipelined multi cycle 16 bit risc educational ...Design and simulation of a non pipelined multi cycle 16 bit risc educational ...
Design and simulation of a non pipelined multi cycle 16 bit risc educational ...
 
20120140502007 2-3
20120140502007 2-320120140502007 2-3
20120140502007 2-3
 
LPC 2148 Instructions Set.ppt
LPC 2148 Instructions Set.pptLPC 2148 Instructions Set.ppt
LPC 2148 Instructions Set.ppt
 
Lecture9
Lecture9Lecture9
Lecture9
 
Arm architecture
Arm architectureArm architecture
Arm architecture
 
BASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGNBASIC COMPUTER ORGANIZATION AND DESIGN
BASIC COMPUTER ORGANIZATION AND DESIGN
 
ARM_2.ppt
ARM_2.pptARM_2.ppt
ARM_2.ppt
 
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic SystemVoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
VoCoRoBo: Remote Speech Recognition and Tilt Sensing Multi-Robotic System
 
Lb35189919904
Lb35189919904Lb35189919904
Lb35189919904
 
CO By Rakesh Roshan
CO By Rakesh RoshanCO By Rakesh Roshan
CO By Rakesh Roshan
 
Sayeh basic computer
Sayeh basic computerSayeh basic computer
Sayeh basic computer
 

More from IOSR Journals (20)

A011140104
A011140104A011140104
A011140104
 
M0111397100
M0111397100M0111397100
M0111397100
 
L011138596
L011138596L011138596
L011138596
 
K011138084
K011138084K011138084
K011138084
 
J011137479
J011137479J011137479
J011137479
 
I011136673
I011136673I011136673
I011136673
 
G011134454
G011134454G011134454
G011134454
 
H011135565
H011135565H011135565
H011135565
 
F011134043
F011134043F011134043
F011134043
 
E011133639
E011133639E011133639
E011133639
 
D011132635
D011132635D011132635
D011132635
 
C011131925
C011131925C011131925
C011131925
 
B011130918
B011130918B011130918
B011130918
 
A011130108
A011130108A011130108
A011130108
 
I011125160
I011125160I011125160
I011125160
 
H011124050
H011124050H011124050
H011124050
 
G011123539
G011123539G011123539
G011123539
 
F011123134
F011123134F011123134
F011123134
 
E011122530
E011122530E011122530
E011122530
 
D011121524
D011121524D011121524
D011121524
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

A0220105

  • 1. IOSR Journal of VLSI and Signal Processing (IOSR-JVSP) Volume 2, Issue 2 (Mar. – Apr. 2013), PP 01-05 e-ISSN: 2319 – 4200, p-ISSN No. : 2319 – 4197 www.iosrjournals.org www.iosrjournals.org 1 | Page Design, Implementation and Testing of 16 bit RISC Processor V. R. Gaikwad (Department of Electronics Engineering, Walchand College of Engineering, Sangli, India) Abstract : Nowadays Embedded Systems have became a part of human life. The most important part of an embedded system is the embedded processor. The performance of embedded processor determines the performance of embedded system. An embedded processor is a Reduced Instruction Set Computer (RISC). In this paper the procedure for designing, implementing and testing a 16 bit RISC processor is presented. This processor was implemented in XC3S400 Field Programmable Gate Array (FPGA) and tested on XC3S400 FPGA development board. This processor is useful for demonstrating hazards in pipeline and the techniques used to solve them. Keywords - Arithmetic and logical unit (ALU), Input output block (IOB), Integrated software environment (ISE), Look up table (LUT), Very high speed integrated circuit hardware descriptive language (VHDL) I. INTRODUCTION A RISC processor uses load-store architecture, fix length instructions and pipelining. In load-store architecture, load instruction reads data from memory and writes it to a register, data processing instructions process data available in registers and write result to a register, and store instruction copies data from register to memory. Pipelining is an implementation technique in which multiple instructions are overlapped in execution [1]. Pipelining improves performance by increasing instruction throughput. To demonstrate how instructions are executed in pipelined processor and the problems created by pipelining, a 16 bit RISC processor supporting eight instructions was designed. The terms byte, half word, word and double are used for 8, 16, 32 and 64 bits data respectively. In mnemonic for an instruction the alphabets b, h, w and d are used for byte, half word, word and double respectively. II. INSTRUCTION SET The first step in design of a RISC processor is the design of instruction set. An instruction set contains instructions supported by the processor. Load instruction reads data from memory and writes it to a register. If the address of memory location is specified in load instruction, the instruction length will exceed the number of bits used to address memory. An alternative to this is, to write the memory address in a register and specify the register in the instruction. In addition to this, if an offset is specified in the instruction then an operand at a known offset from a memory location can be accessed. So, load instruction capable of copying data from the memory location whose address is sum of base register (Rs) content and offset (Imm) to a destination register (Rt), was selected. Store instruction capable of copying data from register (Rt) to the memory location whose address is sum of base register (Rs) and offset (Imm), was selected. Arithmetic and logical instructions process data present in registers. Both arithmetic and logical operations produce a result after processing two operands. In two operands arithmetic and logical instructions one of the two source registers is the destination register. If the destination register is a fixed register then, before performing the next arithmetic or logical operation the result must be copied to other register. If the destination register isn’t a fixed register then, its content will be lost after performing arithmetic or logical operation. In three operands arithmetic and logical instructions, the result is directly written to a register other than or one of the two source registers. So, arithmetic and logical instructions capable of reading data from two source registers (Rs and Rt) and writing result to destination register (Rd), was selected. The normal sequence of program execution can be changed by using branch instruction. An unconditional branch instruction loads program counter (PC) with the value specified in the instruction. Conditional branch instructions modify PC, if the branch condition is true, by an amount equal to the offset specified in the instruction. Table 1 lists the instructions supported by this processor. III. INSTRUCTION FORMAT The second step is design of instruction format. Each instruction is assigned a unique code, known as operation code (Opcode). For eight instructions 3 bits opcode field is required. The opcode field can be reduced to 2 bits by using same opcode for arithmetic and logical instructions and another code, known as function code, to specify the intended arithmetic or logical operations. For five arithmetic and logical instructions 3 bits function field is sufficient. Each register, in register file, is assigned a unique address. To address eight registers,
  • 2. Design, Implementation and Testing of 16 bit RISC Processor www.iosrjournals.org 2 | Page 3 bits address field is required. The systematic placement of these fields in the instruction is referred to as instruction format. For arithmetic and logical instructions, an opcode field, three 3 bits address fields and a function field is required. The resulting instruction format is known as R format. For load, store and branch instructions, an opcode field, two 3 bits address fields and an immediate field is required. The resulting instruction format is known as I format. Table 1 Instruction Set Format Opcode Instruction Operation R (00)2 add Rd, Rs, Rt Rd  Rs + Rt (00)2 sub Rd, Rs, Rt Rd  Rs – Rt (00)2 and Rd, Rs, Rt Rd  Rs & Rt (00)2 or Rd, Rs, Rt Rd  Rs | Rt (00)2 slt Rd, Rs, Rt if (Rs < Rt) then Rd  1 else Rd  0 (11)2 beq Rs, Rt, Imm if (Rs = Rt) then PC  PC + 1 + Imm else PC  PC + 1 I (01)2 lh Rt, Imm(Rs) Rt  Mem[Rs + Imm] (10)2 sh Rt, Imm(Rs) Mem[Rs + Imm]  Rt Table 2 Control Signals Table 3 Truth Table for Control Unit Opcode RegRd RegWr ALUsrc ALUop Branch MemRd MemWr MemtoReg (00)2 1 1 0 (10)2 0 0 0 0 (01)2 0 1 1 (00)2 0 1 0 1 (10)2 0 0 1 (00)2 0 0 1 0 (11)2 0 0 0 (01)2 1 0 0 0 IV. DATAPATH AND CONTROL The third step is design of datapath and control unit. Datapath is a systematic arrangement of hardware components and their interconnection for performing an operation. The instruction set is divided into two or more parts with each part containing instructions which require the same logic or hardware for implementation. In this case the instruction set is divided into three classes, arithmetic and logical, memory reference and branch opcode (2 bits) rs (3 bits) rt (3 bits) rd (3 bits) unused (2 bits) function (3 bits) opcode (2 bits) rs (3 bits) rt (3 bits) imm (8 bits) Control signal Value Function RegRd 0 Selects rt as destination register address 1 Selects rd as destination register address RegWr 0 Disables write to register file 1 Enables write to register file ALUsrc 0 Selects Rt as 2nd source for ALU 1 Selects Imm as 2nd source for ALU ALUop (00)2 Instruction is load or store (01)2 Instruction is branch (10)2 Instruction is arithmetic or logical Branch 0 Instruction isn’t a branch 1 Instruction is branch MemRd 0 No memory read operation 1 Memory read operation MemWr 0 No memory write operation 1 Memory write operation MemtoReg 0 Selects output of ALU 1 Selects output of Memory
  • 3. Design, Implementation and Testing of 16 bit RISC Processor www.iosrjournals.org 3 | Page instructions. The datapath for each instruction class is designed and combined to get the final datapath. While combining datapaths a hardware resource is shared by using multiplexer at its input. Table 4 Truth Table for ALU IM Inst 0 1 R 1 PC NPC Braddr PCsrc Figure 1 Instruction Fetch (IF) Stage Inst[15:14] Inst[13:11] Inst[10:8] Inst[7:0] Control Reg EQUAL Sign Unit File Exten Braddr Imm16 rtdata rsdata Braddr RegRd ALUsrc ALUop MemWr MemRd MemtoReg RegWr NPC Inst rd rddata zflag Figure 2 Instruction Decode (ID) Stage ALUout rsdata rtdata Imm16 ALUsrc 0 1 ALU Imm16[2:0] Control Inst[13:11] Inst[10:8] RegRd 0 1 rd ALUop Figure 3 Execution (EX) Stage ALUout rtdata MemOut DM MemRd MemWr Figure 4 Memory (MEM) Stage ALUout MemOut MemtoReg 0 1 rddata Figure 5 Write Back (WB) Stage ALUop Function field ALU function Operation (00)2 (XXX)2 (010)2 Addition (01)2 (XXX)2 (110)2 Subtraction (10)2 (000)2 (000)2 Bitwise AND (10)2 (001)2 (001)2 Bitwise OR (10)2 (010)2 (010)2 Addition (10)2 (011)2 (110)2 Subtraction (10)2 (111)2 (011)2 Set on less than
  • 4. IOSR Journal of VLSI and Signal Processing (IOSR-JVSP) Volume 2, Issue 2 (Mar. – Apr. 2013), PP 01-05 e-ISSN: 2319 – 4200, p-ISSN No. : 2319 – 4197 www.iosrjournals.org www.iosrjournals.org 4 | Page For each instruction to perform the expected operation control signals are required. The control signals required and the function performed by them is listed in table 2. Control signals are generated by the control unit according to the opcode of instruction. The value of control signal for each instruction is listed in table 3. The ALUop control signal and function field in instruction are used to generate ALU function select signal. The truth table for ALU function select signal is shown in table 4. Depending on the operation performed by each section of datapath, during execution of an instruction, the datapath can be divided into five stages. The five stages are, instruction fetch (IF) (Fig. 1), instruction decode (ID) (Fig. 2), execution (EX) (Fig. 3), data memory access (MEM) (Fig. 4) and write back (WB) (Fig. 5) stage. The operation of each stage was verified by writing VHDL code and simulating it using ISE simulator [2]-[3]. The propagation delay of each stage, as observed in Post Route simulation, is listed in table 5. Table 5 Propagation Delay Table 6 XC3S400 Device Utilization Table 7 Sample Code Figure 6 XC3S400 FPGA Development Board Figure 7 Serial data received in Hyperterminal Stage Propagation Delay IF 13.1 ns ID 12.5 ns EX 16.6 ns MEM 13.6 ns WB 12.3 ns Resource Percentage Number of Slices used 15 % Number of Slice flip flops used 7 % Number of 4 input LUT used 10 % Number of bounded IOB’s used 32 % Number of GCLK’s used 25 % Address Instruction Machine code (0000)2 lh $1, 8($0) (4108)16 (0001)2 sh $1, 9($0) (8109)16 (0010)2 and $0, $0, $0 (0000)16 (0011)2 lh $2, 8($0) (4208)16 (0100)2 sh $2, 9($0) (8209)16 (0101)2 add $3, $1, $2 (0A62)16 (0110)2 sh $3, 9($0) (8309)16 (0111)2 sub $4, $1, $2 (0A83)16 (1000)2 sh $4, 9($0) (8409)16 (1001)2 and $5, $1, $2 (0AA0)16 (1010)2 sh $5, 9($0) (8509)16 (1011)2 slt $6, $5, $4 (2CC7)16 (1100)2 beq $0, $0, -11 (C0F5)16 (1101)2 sh $6, 9($0) (8609)16
  • 5. Design, Implementation and Testing of 16 bit RISC Processor www.iosrjournals.org 5 | Page V. PIPELINING Pipelining is an implementation technique in which multiple instructions are overlapped in execution. The datapath is pipelined by inserting a register, known as pipeline register, between two stages. The stage enclosed between two pipeline registers is known as pipe stage. The PC and pipeline registers are driven by the same clock and reset signal. For pipelined datapath to work properly, clock with period greater than or equal to maximum of propagation delays of pipe stages, is required. For this processor, according to table 5, the minimum clock period is 20 ns. Problems associated with pipelined datapath are referred to as pipeline hazards. Data dependence between instructions results in data hazards. Data hazards are solved by compiler by inserting no operation (NOP) instruction between the instruction producing the result and the instruction using it. In hardware, techniques like forwarding and stalling are used. In data forwarding, the data forwarding logic creates a path from the location in the pipeline where the required data is available to the location where it is required. In stalling, the hazard detection logic detects data hazard and stalls the pipeline. In case of branch instructions, the delay in starting execution of instruction at branch target address, when branch condition is true, results in control hazards. This delay is reduced by modifying the datapath. VHDL codes for pipelined datapath, pipelined datapath with forwarding logic, pipelined datapath with forwarding and stalling logic, and pipelined datapath modified to handle control hazard were written and tested. VI. TESTING The processor was implemented in XC3S400 FPGA. The device utilization is presented in table 6. The XC3S400 development board, from Mechatronics, has 16 input pins, 16 output pins, 4 seven segment LED displays, RS232 interface, USB interface, VGA interface, ADC and DAC. A memory mapped input port at address 8, memory mapped output port at address 9, 4 digit multiplexed display controller and serial transmitter were added to the design. The 4 digit multiplexed display controller was used to display the current instruction fetched from IM (Fig. 6). The serial transmitter was used to transmit, PC contents, instruction fetched, next PC calculated, Rs contents, Rt contents, Imm16, ALU output, ALU output bypassed, memory output, end of line indicator (33), carriage return and line feed, during each clock cycle with 8-N-1 format and 4800 bps. Before transmitting the 16 bit data, it was divided into four 4 bit data and each 4 bit data was converted from binary to ASCII. A test code (table 7) containing the instructions supported by the processor was written to IM, to test the processor. This code contains both data hazard and control hazard. The data obtained in hyperterminal clearly indicates the activities inside the processor. The data dependency between the first and second instruction and fourth and fifth instruction stalls the pipeline. Stalls and one clock cycle branch delay are indicated by square in Fig. 7. VII. CONCLUSION This processor is similar to the 32 bit MIPS processor explained in [1] however, this processor uses word addressing and supports only eight instructions. This processor is useful for demonstrating pipeline hazards and the techniques used to solve them. REFERENCES [1] David A. Patterson and John L. Hennessy, Computer organization and design (Morgan Kaufmann, 1998) [2] Douglas Perry, VHDL Programming (Tata McGraw Hill) [3] John Wakerly, Digital design (PHI) BIBLIOGRAPHY Mr. V. R. Gaikwad born in Maharashtra, in India on December 29, 1977. He graduated from Dr. J. J. Magdum College of Engineering, Jaysingpur and post graduated from Walchand College of Engineering, Sangli. He received B.E and M.Tech. degree in Electronics Engineering from Shivaji University, Kolhapur. He is working as Assistant Professor in the department of electronics engineering at walchand college of engineering, sangli. His fields of interest include circuits and systems, embedded systems and VLSI.