SlideShare a Scribd company logo
Controller
Anees Akhtar
12-ENC-20
Muhammad Nabi Yasinzai
12-ENC-36
Controller Structure
Top Module
• Arithmetic Logic Unit
• Register File
• Program Memory
• Control Unit
Top Module
Program
Memory
Controller
Register File ALU
INST
Opcode
Write Enable
INC
Data A
Address Register A
Address Register B
Output
Data B
Top Module
module Top_Module(Clk,Reset,PRO_COUNT,INSTRUCTION, AD_A, AD_B, AD_D, A_Out , B_Out,ALU_Out,W_E,OP_CODE);
• input Clk , Reset ;
• output [15:0] INSTRUCTION;
• output [3:0] PRO_COUNT;
• output [15:0] A_Out , B_Out ;
• output [2:0] AD_A, AD_B, AD_D;
• output [15:0] ALU_Out;
• output [3:0] OP_CODE;
• output W_E ;
Arithmetic Logic Unit
OpCode [3:0] INST[13:10]
A[15:0]
ALU_Out
[15:0]
B[15:0]
• Two 16 Bit Data inputs (Input A , Input B)
• 4 Bit OpCode(Select lines) To choose A desired Function
• In Our design we have 8 arithmetic operations
& Four Logical Operations.
• One 16 bit ALU output.
• In Our Design the OpCode Holds the [13:10] bits of the instruction.
module AL_Unit (OpCode , A , B , ALU_Out ) ;
input [15 : 0] A , B ;
input [3 : 0] OpCode ;
output [15 : 0] ALU_Out ;
DIFFERENT ALU FUNCTIONS OPCODES
Register File
A address
A_A[2:0]
iNST[4:6]
• Two Read Adresses To Read the Data From two Loctions in the registerfile
• A_Out and B_Out are the output data selected by their addresses.
• Write enable(W_E) is used to write Data on the location selected by
Destination Adress(D_A).
module REGISTER_FILE ( Reset , Clk , A_A , A_B , A_Out , B_Out , W_E, D_A , D_Input);
input Reset, Clk;
input [ 2:0] A_A, A_B;
input W_E;
input [ 2:0] D_A;
input [15:0] D_Input;
output [15:0] A_Out,B_Out;
D-addres
A_B[2:0]
iNST[7:9]
Wrie
enable
iNST[0]
B address
A_B[2:0]
iNST[4:6]
Program Memory
• Progarm memory contains the list of the instructions to be
decoded by the Control unit
• It has a Counter input which increments after each machine cycle
• The counter locates the address of the instruction to be executed
• The instruction is the Output form Progarm Memory and is
provided to the control unit
OUR INSTRUCTIONS SEQUENCE
OPCODE D_Adress A_Adress B_Adress W_Enable OPERATION
1. 00 0010 000 000 001 0 Addition
2. 00 0101 000 100 011 0 Subtraction
3. 00 0001 000 010 000 0 Increment( A )
4. 00 1000 000 111 110 0 Logical AND
Control Unit
• Contol Unit decodes the instruction From the Program Memory and Provides signals to the Other
components.
Its execution consists of three steps.
1. Fetching
2. Decoding
3. Loading
module CONTROL(Clk,Reset,INST_IN,COUNT_ADD,AD_A,AD_B,AD_D,OP_CODE,W_E);
input [15:0]INST_IN;
input Clk,Reset ;
output W_E;
output [3:0] COUNT_ADD ;
output [3:0] OP_CODE ;
output [2:0] AD_A, AD_B, AD_D ;
Clock
Reset
Counter at 0
count
INSTRUCTION
STORED AT 0
OPCODE FOR
ADDITION
Adress of A
000
Adress of B
001
Destination
address
010
Data stored
in register
001
Data stored
in register
000
SUM OF THE
INPUT DATA
Clock
Reset
Counter at 1
count
0001
INSTRUCTION
STORED AT
0001
OPCODE FOR
Subtraction
Adress of A
100
Adress of B
011
Destination
address
000
Data stored
in register
100
Data stored
in register
011
Difference
OF THE
INPUT DATA
Clock
Reset
Counter at 2
count
0010
INSTRUCTION
STORED AT
0010
OPCODE FOR
Increment
0001
Adress of A
010
Adress of B
000
Destination
address
000
Data stored
in register A
010
Data stored
in register B
000
INREMENTED
RESULT
Controller Implementation in Verilog

More Related Content

PPT
Microprocessor - unit 2-Addressing Modes of 8085
PDF
Project single cyclemips processor_verilog
PPT
CPU Register Organization.ppt
PPT
Interrupt programming with 8051 microcontroller
PPTX
Digital electronics logic families
PPTX
I/O Ports
PPSX
ATmega32
Microprocessor - unit 2-Addressing Modes of 8085
Project single cyclemips processor_verilog
CPU Register Organization.ppt
Interrupt programming with 8051 microcontroller
Digital electronics logic families
I/O Ports
ATmega32

What's hot (20)

PPTX
Computer instruction
DOCX
Digital Electronics
PPTX
PDF
PDF
08 Latches and Flipflops.pdf
PPT
De Morgan Theorem B[1]
PPTX
Introduction to arm processor
PPTX
quine mc cluskey method
PPTX
DAC and sensor interfacing with PIC
PPTX
8051 programming skills using EMBEDDED C
PPTX
latches
PPTX
Module 2 ARM CORTEX M3 Instruction Set and Programming
PPT
Assembly Language Lecture 5
PPTX
Periodic vs. aperiodic signal
PDF
Sequential circuits in Digital Electronics
PDF
Solution manual 8051 microcontroller by mazidi
PPTX
Combinational Logic Circuit
PPTX
K - Map
PDF
8085 instructions and addressing modes
PPTX
Plc (processors and dio)
Computer instruction
Digital Electronics
08 Latches and Flipflops.pdf
De Morgan Theorem B[1]
Introduction to arm processor
quine mc cluskey method
DAC and sensor interfacing with PIC
8051 programming skills using EMBEDDED C
latches
Module 2 ARM CORTEX M3 Instruction Set and Programming
Assembly Language Lecture 5
Periodic vs. aperiodic signal
Sequential circuits in Digital Electronics
Solution manual 8051 microcontroller by mazidi
Combinational Logic Circuit
K - Map
8085 instructions and addressing modes
Plc (processors and dio)
Ad

Similar to Controller Implementation in Verilog (20)

PPTX
Introduction to Microprocessor & Code
PDF
H64CSA_1B_023799_Osama
PPTX
Instruction Set Architecture
PPTX
Computer Architecture – An Introduction
PPTX
Programming A Robot Using
PPT
chapter 4
PPT
29317254-Standard-Single-Purpose-Processors-Peripherals.ppt
PPTX
Remote ashok
PPTX
embedded system and AVR
PDF
computer organization and assembly language giki course slides
PPT
Lecture_4-3.ppt on verilog hdl..................................................
PPTX
Ch 2.pptx
PPT
Picmico
PPT
Introduction to Microprocessor & Microcontroller.ppt
PPTX
MICROCONTROLLER.pptx
PPTX
8255 PPI.pptx
PPT
PLCpptFeb222017.ppt
PPT
8255 programming
PDF
GPIO In Arm cortex-m4 tiva-c
PPTX
Whitepaper proposal presentation _pre.pptx
Introduction to Microprocessor & Code
H64CSA_1B_023799_Osama
Instruction Set Architecture
Computer Architecture – An Introduction
Programming A Robot Using
chapter 4
29317254-Standard-Single-Purpose-Processors-Peripherals.ppt
Remote ashok
embedded system and AVR
computer organization and assembly language giki course slides
Lecture_4-3.ppt on verilog hdl..................................................
Ch 2.pptx
Picmico
Introduction to Microprocessor & Microcontroller.ppt
MICROCONTROLLER.pptx
8255 PPI.pptx
PLCpptFeb222017.ppt
8255 programming
GPIO In Arm cortex-m4 tiva-c
Whitepaper proposal presentation _pre.pptx
Ad

Recently uploaded (20)

PDF
composite construction of structures.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Geodesy 1.pptx...............................................
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Simulation of electric circuit laws using tinkercad.pptx
PPTX
web development for engineering and engineering
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
PPTX
Internship_Presentation_Final engineering.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
PPTX
Practice Questions on recent development part 1.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Queuing formulas to evaluate throughputs and servers
PPT
Drone Technology Electronics components_1
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
composite construction of structures.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Geodesy 1.pptx...............................................
Structs to JSON How Go Powers REST APIs.pdf
OOP with Java - Java Introduction (Basics)
Simulation of electric circuit laws using tinkercad.pptx
web development for engineering and engineering
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Internship_Presentation_Final engineering.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Monitoring Global Terrestrial Surface Water Height using Remote Sensing - ARS...
Practice Questions on recent development part 1.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Queuing formulas to evaluate throughputs and servers
Drone Technology Electronics components_1
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Strings in CPP - Strings in C++ are sequences of characters used to store and...

Controller Implementation in Verilog

  • 2. Controller Structure Top Module • Arithmetic Logic Unit • Register File • Program Memory • Control Unit
  • 3. Top Module Program Memory Controller Register File ALU INST Opcode Write Enable INC Data A Address Register A Address Register B Output Data B
  • 4. Top Module module Top_Module(Clk,Reset,PRO_COUNT,INSTRUCTION, AD_A, AD_B, AD_D, A_Out , B_Out,ALU_Out,W_E,OP_CODE); • input Clk , Reset ; • output [15:0] INSTRUCTION; • output [3:0] PRO_COUNT; • output [15:0] A_Out , B_Out ; • output [2:0] AD_A, AD_B, AD_D; • output [15:0] ALU_Out; • output [3:0] OP_CODE; • output W_E ;
  • 5. Arithmetic Logic Unit OpCode [3:0] INST[13:10] A[15:0] ALU_Out [15:0] B[15:0] • Two 16 Bit Data inputs (Input A , Input B) • 4 Bit OpCode(Select lines) To choose A desired Function • In Our design we have 8 arithmetic operations & Four Logical Operations. • One 16 bit ALU output. • In Our Design the OpCode Holds the [13:10] bits of the instruction. module AL_Unit (OpCode , A , B , ALU_Out ) ; input [15 : 0] A , B ; input [3 : 0] OpCode ; output [15 : 0] ALU_Out ;
  • 7. Register File A address A_A[2:0] iNST[4:6] • Two Read Adresses To Read the Data From two Loctions in the registerfile • A_Out and B_Out are the output data selected by their addresses. • Write enable(W_E) is used to write Data on the location selected by Destination Adress(D_A). module REGISTER_FILE ( Reset , Clk , A_A , A_B , A_Out , B_Out , W_E, D_A , D_Input); input Reset, Clk; input [ 2:0] A_A, A_B; input W_E; input [ 2:0] D_A; input [15:0] D_Input; output [15:0] A_Out,B_Out; D-addres A_B[2:0] iNST[7:9] Wrie enable iNST[0] B address A_B[2:0] iNST[4:6]
  • 8. Program Memory • Progarm memory contains the list of the instructions to be decoded by the Control unit • It has a Counter input which increments after each machine cycle • The counter locates the address of the instruction to be executed • The instruction is the Output form Progarm Memory and is provided to the control unit
  • 9. OUR INSTRUCTIONS SEQUENCE OPCODE D_Adress A_Adress B_Adress W_Enable OPERATION 1. 00 0010 000 000 001 0 Addition 2. 00 0101 000 100 011 0 Subtraction 3. 00 0001 000 010 000 0 Increment( A ) 4. 00 1000 000 111 110 0 Logical AND
  • 10. Control Unit • Contol Unit decodes the instruction From the Program Memory and Provides signals to the Other components. Its execution consists of three steps. 1. Fetching 2. Decoding 3. Loading module CONTROL(Clk,Reset,INST_IN,COUNT_ADD,AD_A,AD_B,AD_D,OP_CODE,W_E); input [15:0]INST_IN; input Clk,Reset ; output W_E; output [3:0] COUNT_ADD ; output [3:0] OP_CODE ; output [2:0] AD_A, AD_B, AD_D ;
  • 11. Clock Reset Counter at 0 count INSTRUCTION STORED AT 0 OPCODE FOR ADDITION Adress of A 000 Adress of B 001 Destination address 010 Data stored in register 001 Data stored in register 000 SUM OF THE INPUT DATA
  • 12. Clock Reset Counter at 1 count 0001 INSTRUCTION STORED AT 0001 OPCODE FOR Subtraction Adress of A 100 Adress of B 011 Destination address 000 Data stored in register 100 Data stored in register 011 Difference OF THE INPUT DATA
  • 13. Clock Reset Counter at 2 count 0010 INSTRUCTION STORED AT 0010 OPCODE FOR Increment 0001 Adress of A 010 Adress of B 000 Destination address 000 Data stored in register A 010 Data stored in register B 000 INREMENTED RESULT