SlideShare a Scribd company logo
1 of 4
SEQUENTIAL LOGIC MODELING EXAMPLE
USING 2-PROCESS MODELING STYLE
Dr.R.P.Rao
Din
ADD
RAM
2N
words
M bits/word
WE
Dout
PUSH
POP
FIFO
Control Logic
ADD
WE
INIT
FULL
EMPTY
NOPOP
NOPUSH
CLK
First-In First-Out (FIFO) Control Logic VHDL Modeling Example
A common problem in design is constructing a FIFO from a RAM by designing the control logic
to generate the address (ADD) and write enable (WE) to the RAM so that the first data word
written into the RAM is also the first data word retrieved from the RAM. Therefore, we want to
write a parameterized VHDL model for a FIFO (using one process for sequential logic
operations and one process for combinational logic operations). The VHDL model will
implement the logic required to make a pipelined RAM operate as the FIFO. In this case, the
RAM is assumed to have separate data inputs and outputs, an N-bit address bus (ADD) and an
active high write enable (WE). The inputs to the FIFO/Stack logic include PUSH, POP, INIT
(all active high) in addition to the rising edge triggered CLK input. The FIFO logic will not only
supply the address and write enable to the RAM, but will also supply active high flags for FULL,
EMPTY, NOPOP and NOPUSH conditions. The NOPOP and NOPUSH flags indicate that no
FIFO read or write operation was executed due to one of the following conditions:
1. simultaneous assertion of both PUSH and POP - the POP takes priority => NOPUSH
2. assertion of PUSH when the FIFO is full => NOPUSH
3. assertion of POP when the FIFO is empty => NOPOP
M
M
M
N
M
Data In
PUSH
POP
FIFO
INIT
CLK
FULL
EMPTY
NOPOP
NOPUSH
Data Out
SEQUENTIAL LOGIC MODELING EXAMPLE
USING 2-PROCESS MODELING STYLE
Dr.R.P.Rao
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity FIFO_LOGIC is
generic (N: integer := 3);
port (CLK, PUSH, POP, INIT: in std_logic;
ADD: out std_logic_vector(N-1 downto 0);
FULL, EMPTY, WE, NOPUSH, NOPOP: buffer std_logic);
end entity FIFO_LOGIC;
architecture RTL of FIFO_LOGIC is
signal WPTR, RPTR: std_logic_vector(N-1 downto 0);
signal LASTOP: std_logic;
begin
SYNC: process (CLK) begin
if (CLK'event and CLK = '1') then
if (INIT = '1') then -- initialization --
WPTR <= (others => '0');
RPTR <= (others => '0');
LASTOP <= '0';
elsif (POP = '1' and EMPTY = '0') then -- pop --
RPTR <= RPTR + 1;
LASTOP <= '0';
elsif (PUSH = '1' and FULL = '0') then -- push --
WPTR <= WPTR + 1;
LASTOP <= '1';
end if; -- otherwise all Fs hold their value --
end if;
end process SYNC;
COMB: process (PUSH, POP, WPTR, RPTR, LASTOP, FULL, EMPTY) begin
-- full and empty flags --
if (RPTR = WPTR) then
if (LASTOP = '1') then
FULL <= '1';
EMPTY <= '0';
else
else
end if;
FULL <= '0';
EMPTY <= '1';
end if;
FULL <= '0';
EMPTY <= '0';
SEQUENTIAL LOGIC MODELING EXAMPLE
USING 2-PROCESS MODELING STYLE
Dr.R.P.Rao
-- address, write enable and nopush/nopop logic --
if (POP = '0' and PUSH = '0') then -- no operation--
ADD <= RPTR;
WE <= '0';
NOPUSH <= '0';
NOPOP <= '0';
elsif (POP = '0' and PUSH = '1') then -- push only --
ADD <= WPTR;
NOPOP <= '0';
if (FULL = '0') then -- valid write condition --
WE <= '1';
NOPUSH <= '0';
else -- no write condition --
WE <= '0';
NOPUSH <= '1';
end if;
elsif (POP = '1' and PUSH = '0') then -- pop only --
ADD <= RPTR;
NOPUSH <= '0';
WE <= '0';
if (EMPTY = '0') then -- valid read condition --
NOPOP <= '0';
else
end if;
NOPOP <= '1'; -- no red condition --
else -- push and pop at same time –
if (EMPTY = β€˜0’) then -- valid pop --
ADD <= RPTR;
WE <= '0';
NOPUSH <= '1';
NOPOP <= '0';
end if;
else
end if;
ADD <= wptr;
WE <= β€˜1’;
NOPUSH <= β€˜0’;
NOPOP <= β€˜1’;
end process COMB;
end architecture RTL;
SEQUENTIAL LOGIC MODELING EXAMPLE
USING 2-PROCESS MODELING STYLE
Dr.R.P.Rao
With a VHDL model for the RAM and FIFO controllogic complete, we can
generate a top-level hierarchical model of the complete FIFO:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity FIFO is
generic (N: integer := 3; -- number of address bits for 2**N address locations
M: integer := 5); -- number of data bits to/from FIFO
port (CLK, PUSH, POP, INIT: in std_logic;
DIN: in std_logic_vector(N-1 downto 0);
DOUT: out std_logic_vector(N-1 downto 0);
FULL, EMPTY, NOPUSH, NOPOP: out std_logic);
end entity FIFO;
architecture TOP_HIER of FIFO is
signal WE: std_logic;
signal A: std_logic_vector(N-1 downto 0);
component FIFO_LOGIC is
generic (N: integer); -- number of address bits
port (CLK, PUSH, POP, INIT: in std_logic;
ADD: out std_logic_vector(N-1 downto 0);
FULL, EMPTY, WE, NOPUSH, NOPOP: buffer std_logic);
end component FIFO_LOGIC;
component RAM is
generic (K, W: integer) -- number of address and data bits
port (WR: in std_logic; -- active high write enable
ADDR: in std _ logic _vector (W-1 downto 0); -- RAM address
DIN: in std _ logic _ vector (K-1 downto 0); -- write data
DOUT: out std _ logic _ vector (K-1 downto 0)); -- read data
end component RAM;
begin
-- example of component instantiation using positional notation
FL: FIFO_LOGIC generic map (N)
port map (CLK, PUSH, POP, INIT, A, FULL, EMPTY, WE, NOPUSH, NOPOP);
-- example of component instantiation using keyword notation
R: RAM generic map (W => N, K => M)
port map (DIN => DIN, ADDR => A, WR => WE, DOUT => DOUT);
end architecture TOP_HIER;

More Related Content

What's hot

8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED CAman Sharma
Β 
Input Output programming in AVR microcontroller
Input  Output  programming in AVR microcontrollerInput  Output  programming in AVR microcontroller
Input Output programming in AVR microcontrollerRobo India
Β 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CVarun A M
Β 
Chapter 7 8051 programming in c
Chapter 7  8051 programming in cChapter 7  8051 programming in c
Chapter 7 8051 programming in cAbdelrahman Elewah
Β 
New text document
New text documentNew text document
New text documentRoja Patro
Β 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in CSudhanshu Janwadkar
Β 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly languagehemant meena
Β 
Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Arkhom Jodtang
Β 
B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)MahiboobAliMulla
Β 
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...Hsien-Hsin Sean Lee, Ph.D.
Β 
TLPI - 6 Process
TLPI - 6 ProcessTLPI - 6 Process
TLPI - 6 ProcessShu-Yu Fu
Β 
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...Linaro
Β 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerMarina Kolpakova
Β 
Unit 6 assembly language programming
Unit 6   assembly language programmingUnit 6   assembly language programming
Unit 6 assembly language programmingKartik Sharma
Β 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setStefan Oprea
Β 
Embedded systems io programming
Embedded systems   io programmingEmbedded systems   io programming
Embedded systems io programmingimtiazalijoono
Β 
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Hsien-Hsin Sean Lee, Ph.D.
Β 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilogvenravi10
Β 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instructionprashant1271
Β 

What's hot (20)

8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
Β 
Input Output programming in AVR microcontroller
Input  Output  programming in AVR microcontrollerInput  Output  programming in AVR microcontroller
Input Output programming in AVR microcontroller
Β 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
Β 
Chapter 7 8051 programming in c
Chapter 7  8051 programming in cChapter 7  8051 programming in c
Chapter 7 8051 programming in c
Β 
New text document
New text documentNew text document
New text document
Β 
Intel 8051 Programming in C
Intel 8051 Programming in CIntel 8051 Programming in C
Intel 8051 Programming in C
Β 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
Β 
Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine
Β 
8051assembly language
8051assembly language8051assembly language
8051assembly language
Β 
B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)B sc e 5.2 mp unit 2 soft ware(alp)
B sc e 5.2 mp unit 2 soft ware(alp)
Β 
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Pr...
Β 
TLPI - 6 Process
TLPI - 6 ProcessTLPI - 6 Process
TLPI - 6 Process
Β 
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
BKK16-503 Undefined Behavior and Compiler Optimizations – Why Your Program St...
Β 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Β 
Unit 6 assembly language programming
Unit 6   assembly language programmingUnit 6   assembly language programming
Unit 6 assembly language programming
Β 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
Β 
Embedded systems io programming
Embedded systems   io programmingEmbedded systems   io programming
Embedded systems io programming
Β 
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec8 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Β 
Lecture 2 verilog
Lecture 2   verilogLecture 2   verilog
Lecture 2 verilog
Β 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instruction
Β 

Similar to Hd10

Realization of an 8 bit pipelined microprocessor in verilog hdl
Realization of an 8 bit pipelined microprocessor in verilog hdlRealization of an 8 bit pipelined microprocessor in verilog hdl
Realization of an 8 bit pipelined microprocessor in verilog hdlAlexander Decker
Β 
8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.pptnotagain0712
Β 
Designing of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLDesigning of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLJay Baxi
Β 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollerjokersclown57
Β 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Eueung Mulyana
Β 
Alu design-project
Alu design-projectAlu design-project
Alu design-projectalphankg1
Β 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent vijaydeepakg
Β 
Cisco CCNA IP SLA with tracking configuration
Cisco CCNA IP SLA  with tracking  configurationCisco CCNA IP SLA  with tracking  configuration
Cisco CCNA IP SLA with tracking configurationHamed Moghaddam
Β 
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdfShashiKiran664181
Β 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5PRADEEP
Β 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorDaniel Roggen
Β 
lec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdflec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdfhasan58964
Β 
Practical file
Practical filePractical file
Practical filerajeevkr35
Β 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESkarthik kadava
Β 
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsPragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsMarina Kolpakova
Β 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational CircuitsFarzan Dehbashi
Β 

Similar to Hd10 (20)

Realization of an 8 bit pipelined microprocessor in verilog hdl
Realization of an 8 bit pipelined microprocessor in verilog hdlRealization of an 8 bit pipelined microprocessor in verilog hdl
Realization of an 8 bit pipelined microprocessor in verilog hdl
Β 
8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt8051 MMD Chapter 1.ppt
8051 MMD Chapter 1.ppt
Β 
Designing of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDLDesigning of fifo and serial peripheral interface protocol using Verilog HDL
Designing of fifo and serial peripheral interface protocol using Verilog HDL
Β 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
Β 
Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+Connectivity for Local Sensors and Actuators Using nRF24L01+
Connectivity for Local Sensors and Actuators Using nRF24L01+
Β 
Alp 8051
Alp 8051Alp 8051
Alp 8051
Β 
Hd2
Hd2Hd2
Hd2
Β 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
Β 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent
Β 
Cisco CCNA IP SLA with tracking configuration
Cisco CCNA IP SLA  with tracking  configurationCisco CCNA IP SLA  with tracking  configuration
Cisco CCNA IP SLA with tracking configuration
Β 
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
Β 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
Β 
EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5EMBEDDED SYSTEMS 4&5
EMBEDDED SYSTEMS 4&5
Β 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational Processor
Β 
lec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdflec15_x86procedure_4up.pdf
lec15_x86procedure_4up.pdf
Β 
Practical file
Practical filePractical file
Practical file
Β 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLES
Β 
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsPragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Β 
3D-DRESD Lorenzo Pavesi
3D-DRESD Lorenzo Pavesi3D-DRESD Lorenzo Pavesi
3D-DRESD Lorenzo Pavesi
Β 
Combinational Circuits
Combinational CircuitsCombinational Circuits
Combinational Circuits
Β 

More from Prakash Rao

Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao Prakash Rao
Β 
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines  by Dr. R. Prakash RaoElectromagnetic Theory and Transmission Lines  by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash RaoPrakash Rao
Β 
VLSI DESIGN
VLSI DESIGN VLSI DESIGN
VLSI DESIGN Prakash Rao
Β 
BIASING OF BJT
BIASING OF BJT BIASING OF BJT
BIASING OF BJT Prakash Rao
Β 

More from Prakash Rao (20)

PAL
PALPAL
PAL
Β 
Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao Digital Signal Processing by Dr. R. Prakash Rao
Digital Signal Processing by Dr. R. Prakash Rao
Β 
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines  by Dr. R. Prakash RaoElectromagnetic Theory and Transmission Lines  by Dr. R. Prakash Rao
Electromagnetic Theory and Transmission Lines by Dr. R. Prakash Rao
Β 
VLSI15
VLSI15VLSI15
VLSI15
Β 
VLSI14
VLSI14VLSI14
VLSI14
Β 
VLSI13
VLSI13VLSI13
VLSI13
Β 
VLSI12
VLSI12VLSI12
VLSI12
Β 
VLSI11
VLSI11VLSI11
VLSI11
Β 
VLSI9
VLSI9VLSI9
VLSI9
Β 
VLSI8
VLSI8VLSI8
VLSI8
Β 
VLSI7
VLSI7VLSI7
VLSI7
Β 
VLSI6
VLSI6VLSI6
VLSI6
Β 
VLSI5
VLSI5VLSI5
VLSI5
Β 
VLSI4
VLSI4VLSI4
VLSI4
Β 
VLSI3
VLSI3VLSI3
VLSI3
Β 
VLSI2
VLSI2VLSI2
VLSI2
Β 
VLSI DESIGN
VLSI DESIGN VLSI DESIGN
VLSI DESIGN
Β 
VLSI10
VLSI10VLSI10
VLSI10
Β 
Fet
FetFet
Fet
Β 
BIASING OF BJT
BIASING OF BJT BIASING OF BJT
BIASING OF BJT
Β 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
Β 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
Β 
Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”
Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”
Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”soniya singh
Β 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
Β 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
Β 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
Β 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
Β 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
Β 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
Β 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
Β 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
Β 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
Β 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
Β 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
Β 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
Β 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
Β 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
Β 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoΓ£o Esperancinha
Β 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
Β 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
Β 
Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”
Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”
Model Call Girl in Narela Delhi reach out to us at πŸ”8264348440πŸ”
Β 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
Β 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Β 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Β 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Β 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
Β 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
Β 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
Β 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Β 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
Β 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
Β 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
Β 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
Β 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
Β 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
Β 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
Β 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Β 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Β 

Hd10

  • 1. SEQUENTIAL LOGIC MODELING EXAMPLE USING 2-PROCESS MODELING STYLE Dr.R.P.Rao Din ADD RAM 2N words M bits/word WE Dout PUSH POP FIFO Control Logic ADD WE INIT FULL EMPTY NOPOP NOPUSH CLK First-In First-Out (FIFO) Control Logic VHDL Modeling Example A common problem in design is constructing a FIFO from a RAM by designing the control logic to generate the address (ADD) and write enable (WE) to the RAM so that the first data word written into the RAM is also the first data word retrieved from the RAM. Therefore, we want to write a parameterized VHDL model for a FIFO (using one process for sequential logic operations and one process for combinational logic operations). The VHDL model will implement the logic required to make a pipelined RAM operate as the FIFO. In this case, the RAM is assumed to have separate data inputs and outputs, an N-bit address bus (ADD) and an active high write enable (WE). The inputs to the FIFO/Stack logic include PUSH, POP, INIT (all active high) in addition to the rising edge triggered CLK input. The FIFO logic will not only supply the address and write enable to the RAM, but will also supply active high flags for FULL, EMPTY, NOPOP and NOPUSH conditions. The NOPOP and NOPUSH flags indicate that no FIFO read or write operation was executed due to one of the following conditions: 1. simultaneous assertion of both PUSH and POP - the POP takes priority => NOPUSH 2. assertion of PUSH when the FIFO is full => NOPUSH 3. assertion of POP when the FIFO is empty => NOPOP M M M N M Data In PUSH POP FIFO INIT CLK FULL EMPTY NOPOP NOPUSH Data Out
  • 2. SEQUENTIAL LOGIC MODELING EXAMPLE USING 2-PROCESS MODELING STYLE Dr.R.P.Rao library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity FIFO_LOGIC is generic (N: integer := 3); port (CLK, PUSH, POP, INIT: in std_logic; ADD: out std_logic_vector(N-1 downto 0); FULL, EMPTY, WE, NOPUSH, NOPOP: buffer std_logic); end entity FIFO_LOGIC; architecture RTL of FIFO_LOGIC is signal WPTR, RPTR: std_logic_vector(N-1 downto 0); signal LASTOP: std_logic; begin SYNC: process (CLK) begin if (CLK'event and CLK = '1') then if (INIT = '1') then -- initialization -- WPTR <= (others => '0'); RPTR <= (others => '0'); LASTOP <= '0'; elsif (POP = '1' and EMPTY = '0') then -- pop -- RPTR <= RPTR + 1; LASTOP <= '0'; elsif (PUSH = '1' and FULL = '0') then -- push -- WPTR <= WPTR + 1; LASTOP <= '1'; end if; -- otherwise all Fs hold their value -- end if; end process SYNC; COMB: process (PUSH, POP, WPTR, RPTR, LASTOP, FULL, EMPTY) begin -- full and empty flags -- if (RPTR = WPTR) then if (LASTOP = '1') then FULL <= '1'; EMPTY <= '0'; else else end if; FULL <= '0'; EMPTY <= '1'; end if; FULL <= '0'; EMPTY <= '0';
  • 3. SEQUENTIAL LOGIC MODELING EXAMPLE USING 2-PROCESS MODELING STYLE Dr.R.P.Rao -- address, write enable and nopush/nopop logic -- if (POP = '0' and PUSH = '0') then -- no operation-- ADD <= RPTR; WE <= '0'; NOPUSH <= '0'; NOPOP <= '0'; elsif (POP = '0' and PUSH = '1') then -- push only -- ADD <= WPTR; NOPOP <= '0'; if (FULL = '0') then -- valid write condition -- WE <= '1'; NOPUSH <= '0'; else -- no write condition -- WE <= '0'; NOPUSH <= '1'; end if; elsif (POP = '1' and PUSH = '0') then -- pop only -- ADD <= RPTR; NOPUSH <= '0'; WE <= '0'; if (EMPTY = '0') then -- valid read condition -- NOPOP <= '0'; else end if; NOPOP <= '1'; -- no red condition -- else -- push and pop at same time – if (EMPTY = β€˜0’) then -- valid pop -- ADD <= RPTR; WE <= '0'; NOPUSH <= '1'; NOPOP <= '0'; end if; else end if; ADD <= wptr; WE <= β€˜1’; NOPUSH <= β€˜0’; NOPOP <= β€˜1’; end process COMB; end architecture RTL;
  • 4. SEQUENTIAL LOGIC MODELING EXAMPLE USING 2-PROCESS MODELING STYLE Dr.R.P.Rao With a VHDL model for the RAM and FIFO controllogic complete, we can generate a top-level hierarchical model of the complete FIFO: library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity FIFO is generic (N: integer := 3; -- number of address bits for 2**N address locations M: integer := 5); -- number of data bits to/from FIFO port (CLK, PUSH, POP, INIT: in std_logic; DIN: in std_logic_vector(N-1 downto 0); DOUT: out std_logic_vector(N-1 downto 0); FULL, EMPTY, NOPUSH, NOPOP: out std_logic); end entity FIFO; architecture TOP_HIER of FIFO is signal WE: std_logic; signal A: std_logic_vector(N-1 downto 0); component FIFO_LOGIC is generic (N: integer); -- number of address bits port (CLK, PUSH, POP, INIT: in std_logic; ADD: out std_logic_vector(N-1 downto 0); FULL, EMPTY, WE, NOPUSH, NOPOP: buffer std_logic); end component FIFO_LOGIC; component RAM is generic (K, W: integer) -- number of address and data bits port (WR: in std_logic; -- active high write enable ADDR: in std _ logic _vector (W-1 downto 0); -- RAM address DIN: in std _ logic _ vector (K-1 downto 0); -- write data DOUT: out std _ logic _ vector (K-1 downto 0)); -- read data end component RAM; begin -- example of component instantiation using positional notation FL: FIFO_LOGIC generic map (N) port map (CLK, PUSH, POP, INIT, A, FULL, EMPTY, WE, NOPUSH, NOPOP); -- example of component instantiation using keyword notation R: RAM generic map (W => N, K => M) port map (DIN => DIN, ADDR => A, WR => WE, DOUT => DOUT); end architecture TOP_HIER;