SlideShare a Scribd company logo
1 of 27
Digital Design Using Verilog -For Absolute Beginners
LECTURE4 :DATA FLOW MODELLING
Introduction-Data Flow Modelling
•For simple circuits, the gate-level modeling
approach works fine because the number of gates is
limited and the designer can instantiate and connect
every gate individually.
•Also, the gate-level modeling is very intuitive to a
designer with a basic knowledge of digital logic
design.
•But , in complex designs where the number of gates
is very large it is not the case. (that easy)
•So, for efficient designing, the designers prefer a
higher level of abstraction than gate level .
contd
• An important point here is, as the designer is aware of
how data flows between hard ware components
(Registers) and how data is being processed in the
design, this model is more convenient to the
designers.
• Another reason for importance of Data flow modelling
is the unprecedented growth in the gate density on a
chip which made the Gate level modelling very
complicated.
• Also, presently automated tools are readily available,
to create a gate level circuit from data flow design
description easily.(This process is called Synthesis).
contd..
• This Data Flow model is also known as
Continuous Assignment model.
• This type of modelling or style is more suitable for
combinational logic circuits where clock is not
involved as any control signal .
• As the output of a logic gate is continuously driving
the input of another gate ,it is popularly known as
Continuous assignment model.
• The Assignment statement starts with the keyword
“assign”
17 June 2020 4yayavaram@yahoo.com
Continuous Assignments
• A continuous assignment is the most basic
statement in dataflow modeling, used to drive a
value onto a net.
• This assignment replaces gates in the description of
the circuit and describes the circuit at a higher level
of abstraction.
• The assignment statement starts with the keyword
assign.
• For ex: assign A = B | C ( B OR C).
• Similarly A = B & C
• Here the assignment is continuously active.
17 June 2020 5yayavaram@yahoo.com
Contd
• The assign keyword creates a static binding
between RHS and LHS of the above expressions.
• So, w.r.t simulation, the output is continuously
active. i.e Continuous assignments are always
active.
• The assignment expression is evaluated as soon as
one of the right-hand-side operands changes .
• The operands on the right-hand side can be registers
or nets or function calls. Registers or nets can be
scalars or vectors.
17 June 2020 6yayavaram@yahoo.com
contd
• The left hand side of an assignment must always be
a scalar or vector net or a concatenation of scalar
and vector nets. It cannot be a scalar or vector
register.
• Here net and Reg are a kind of data types.
• In a simple terminology Nets represent connection
between components. Ex: wire B;
• Nets must be continuously driven and are used
model connections between continuous assignments
& instantiations.
17 June 2020 7yayavaram@yahoo.com
contd
• Where as the Reg(Register) retains the last value
assigned to it until another assignment statement
changes their value.
• Its often used to represent storage elements.
• Net and Register data types can be declared as
vectors (multiple bit width).
• For ex: wire [3:0] a;
• wire[31:0]b;
• reg[7:0] c;
• reg[31:0] d;
17 June 2020 8yayavaram@yahoo.com
Ex 1: HALF ADDER
• module Half_ adder(s,c,a,b);
input a , b; // Declare input Ports
output s, c; // Declare out ports
assign s = a ^ b; // assign statement for x-or
assign c= a & b; // assign statement for logical and
endmodule.
17 June 2020 9yayavaram@yahoo.com
Ex 2: Multiplexer
• The block diagram of Mux is shown below.
17 June 2020 10yayavaram@yahoo.com
contd
• The out put of Mux is
here S is the select line and A,B are inputs.
• Here two logical ‘and’ operations, one NOT
operation and one OR operations are involved.
• Using the assign statements the Verilog can be
written .
17 June 2020 11yayavaram@yahoo.com
Verilog code-Mux
module mymux2_1(A,B,S,Y);
output y;
input A,B,S;
assign Y= (A &(~S) | (B &S));
endmodule
In the above code, & denotes logical ‘and’, ~ Denotes
not , | denotes logical or operations.
17 June 2020 12yayavaram@yahoo.com
Verilog code-Mux(Aliter)
The same code can also be written by another simple
method shown below.
module mymux2_1(A,B,S,Y);
output Y;
input A,B,S;
assign Y= S ? B:A;
endmodule
Note: here ? is the conditional Operator. Y = B when
S=1 else Y=A. (This is a ternary operator)
17 June 2020 13yayavaram@yahoo.com
Conditional operator (?)
• ? Is a conditional operator which is a very useful
ternary operator.
• The conditional operator(? :) takes three operands.
• Usage is ”condition-expr ? true-expr : false-expr ;”
• The condition expression (condition-expr ) is first
evaluated.
• If the result is true (logical 1), then the true-expr is
evaluated. If the result is false (logical 0), then the
false-expression is evaluated.
17 June 2020 14yayavaram@yahoo.com
Ex 3: Full Adder
• Full adder has three input bits and two output bits
sum and carry-out as shown in the diagram below.
• In the diagram A, B, Cin are inputs and Sum &
Cout are outputs.
17 June 2020 15yayavaram@yahoo.com
Verilog code-Full Adder
module myFA1(S,Cout,A,B,Cin);
//Port declaration
output S,Cout;
input A,B,Cin;
assign S= (A^B^Cin); //x-or operation
assign Cout = (A&B | B & Cin | Cin & A);
endmodule
17 June 2020 16yayavaram@yahoo.com
Full Adder -16 bit
module myHA_16(S,Cout,A,B,Cin);
output [15:0]S;
output Cout ;
input [15:0]A ; //here A,B ,S are defined as wire
input [15:0] B;
input Cin ;
assign S[15:0] = A[15:0]^B[15:0]^Cin ;
assign Cout = A[15:0]&B[15:0] | B[15:0]&Cin | Cin
& A[15:0];
endmodule17 June 2020 17yayavaram@yahoo.com
2-4 Decoder with Enable
• Decoder is a combinational circuit that has ‘n’ input
lines and maximum of 2n output lines.
• The diagram shows a 2 to 4 Decoder with two
inputs A & B , an enable pin E and four outputs
D3,D2,D1,D0 .
17 June 2020 18yayavaram@yahoo.com
contd
• The working of the decoder can be under stood from
the truth table shown below.
17 June 2020 19yayavaram@yahoo.com
Ex: 2 to 4 Line Decoder
• module decoder2_4 (A,B,E,D);
input A,B,E;
output [3:0]D;
assign D[3] =~(~A & ~B & ~E);
assign D[2] =~(~A & B & ~E);
assign D[1] =~( A & ~B & ~E);
assign D[0] =~( A & B & ~E);
endmodule
17 June 2020 20yayavaram@yahoo.com
Ex: Half Subtractor
• The diagram below shows the Half Subtractor.It has
two inputs .A & B and two outputs Difference (D)
and borrow(B).
• Difference is given by = A ^ B
• Borrow is given by Bo =
17 June 2020 21yayavaram@yahoo.com
Verilog Code
• module half_sub(D,Bo,A,B);
input A;
input B;
output D, Bo;
assign D = A ^ B ;
• assign borrow=(~A)&B;
• endmodule
17 June 2020 22yayavaram@yahoo.com
Full Subtractor
• Similar to Full adder, Full subtractor has three input
bits and two output bits, Difference and Borrow.
• The logic diagram is shown below.
17 June 2020 23yayavaram@yahoo.com
contd
• In the diagram A,B,C are inputs ;and D and Bo are
outputs.
• The Difference of the Full subtractor is given by
• D = A^(B^C)
• Bo =(B&C)|(A&(B^C)’)
17 June 2020 24yayavaram@yahoo.com
Verilog Code
• module full_sub (D,Bo,A,B,C);
input A,B,C;
output D, Bo;
assign X = B^C;
• assign D = A ^ X;
• assign N =~ C;
• assign Y=B & N;
• assign N1 =~ X;
• assign z = A & N1;
• assign Bo = Y | z;
• endmodule
17 June 2020 25yayavaram@yahoo.com
Verilog Code(Another way)
From the Block Diagram the assignment model is
• module full_sub (D,Bo,A,B,C);
input A,B,C;
output D, Bo;
assign D = A ^ (B^C);
assign Bo = B & C| (A&(B^C)’);
• endmodule
17 June 2020 26yayavaram@yahoo.com
THANQ FOR WATCHING
PATIENTLY
17 June 2020 27yayavaram@yahoo.com

More Related Content

What's hot

Verilog data types -For beginners
Verilog data types -For beginnersVerilog data types -For beginners
Verilog data types -For beginnersDr.YNM
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
Combinational Circuits & Sequential Circuits
Combinational Circuits & Sequential CircuitsCombinational Circuits & Sequential Circuits
Combinational Circuits & Sequential Circuitsgourav kottawar
 
Logic synthesis using Verilog HDL
Logic synthesis using Verilog HDLLogic synthesis using Verilog HDL
Logic synthesis using Verilog HDLanand hd
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
Verilog operators
Verilog operatorsVerilog operators
Verilog operatorsDr.YNM
 
VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments Dr.YNM
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test BenchDr.YNM
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flopShuaib Hotak
 
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilogJITU MISTRY
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functionsanand hd
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machinesIrfan Anjum
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation finalAnkur Gupta
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderBharti Airtel Ltd.
 

What's hot (20)

Verilog data types -For beginners
Verilog data types -For beginnersVerilog data types -For beginners
Verilog data types -For beginners
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
 
Verilog
VerilogVerilog
Verilog
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Combinational Circuits & Sequential Circuits
Combinational Circuits & Sequential CircuitsCombinational Circuits & Sequential Circuits
Combinational Circuits & Sequential Circuits
 
Logic synthesis using Verilog HDL
Logic synthesis using Verilog HDLLogic synthesis using Verilog HDL
Logic synthesis using Verilog HDL
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Verilog operators
Verilog operatorsVerilog operators
Verilog operators
 
VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments VERILOG HDL :: Blocking & NON- Blocking assignments
VERILOG HDL :: Blocking & NON- Blocking assignments
 
Verilog Tasks and functions
Verilog Tasks and functionsVerilog Tasks and functions
Verilog Tasks and functions
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 
Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)Verilog lab manual (ECAD and VLSI Lab)
Verilog lab manual (ECAD and VLSI Lab)
 
Latches and flip flop
Latches and flip flopLatches and flip flop
Latches and flip flop
 
Delays in verilog
Delays in verilogDelays in verilog
Delays in verilog
 
Verilog Tasks & Functions
Verilog Tasks & FunctionsVerilog Tasks & Functions
Verilog Tasks & Functions
 
Moore and Mealy machines
Moore and Mealy machinesMoore and Mealy machines
Moore and Mealy machines
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 

Similar to Data flow model -Lecture-4

Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logicDeepak John
 
1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdf1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdfRohitkumarYadav80
 
1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdf1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdfRohitkumarYadav80
 
18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptx18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptxtakix43466
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001Ralph Weber
 
Lec 05 - Combinational Logic
Lec 05 - Combinational LogicLec 05 - Combinational Logic
Lec 05 - Combinational LogicVajira Thambawita
 
Computer Architechture and microprocesssors
Computer Architechture and microprocesssors Computer Architechture and microprocesssors
Computer Architechture and microprocesssors JaykumarPatil10
 
2-bit comparator
2-bit comparator2-bit comparator
2-bit comparatorIslam Adel
 
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...UmerKhan147799
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLABRavikiran A
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfTamiratDejene1
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2alhadi81
 

Similar to Data flow model -Lecture-4 (20)

Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logic
 
1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdf1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdf
 
1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdf1. Combinational Logic Circutis with examples (1).pdf
1. Combinational Logic Circutis with examples (1).pdf
 
18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptx18CSC203J_COA_Unit 2 final.pptx
18CSC203J_COA_Unit 2 final.pptx
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001
 
Lec 05 - Combinational Logic
Lec 05 - Combinational LogicLec 05 - Combinational Logic
Lec 05 - Combinational Logic
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
 
L7 pointers
L7 pointersL7 pointers
L7 pointers
 
Computer Architechture and microprocesssors
Computer Architechture and microprocesssors Computer Architechture and microprocesssors
Computer Architechture and microprocesssors
 
IJETT-V9P226
IJETT-V9P226IJETT-V9P226
IJETT-V9P226
 
2-bit comparator
2-bit comparator2-bit comparator
2-bit comparator
 
C-PPT.pdf
C-PPT.pdfC-PPT.pdf
C-PPT.pdf
 
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
Lecture6 Chapter4- Design Magnitude Comparator Circuit, Introduction to Decod...
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Chapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdfChapter 5_combinational logic (EEEg4302).pdf
Chapter 5_combinational logic (EEEg4302).pdf
 
Cpmprt
CpmprtCpmprt
Cpmprt
 
SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2SKEL 4273 CAD with HDL Topic 2
SKEL 4273 CAD with HDL Topic 2
 

More from Dr.YNM

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.pptDr.YNM
 
Atmel.ppt
Atmel.pptAtmel.ppt
Atmel.pptDr.YNM
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.pptDr.YNM
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.pptDr.YNM
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.pptDr.YNM
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxDr.YNM
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.pptDr.YNM
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptxDr.YNM
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptDr.YNM
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptxDr.YNM
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxDr.YNM
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step inputDr.YNM
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESDr.YNM
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTUREDr.YNM
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE Dr.YNM
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4Dr.YNM
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architectureDr.YNM
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-IIIDr.YNM
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSDr.YNM
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture IIDr.YNM
 

More from Dr.YNM (20)

Introduction to DSP.ppt
Introduction to DSP.pptIntroduction to DSP.ppt
Introduction to DSP.ppt
 
Atmel.ppt
Atmel.pptAtmel.ppt
Atmel.ppt
 
PIC Microcontrollers.ppt
PIC Microcontrollers.pptPIC Microcontrollers.ppt
PIC Microcontrollers.ppt
 
Crystalstructure-.ppt
Crystalstructure-.pptCrystalstructure-.ppt
Crystalstructure-.ppt
 
Basics of OS & RTOS.ppt
Basics of OS & RTOS.pptBasics of OS & RTOS.ppt
Basics of OS & RTOS.ppt
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptx
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Introduction to ASICs.pptx
Introduction to ASICs.pptxIntroduction to ASICs.pptx
Introduction to ASICs.pptx
 
VHDL-PRESENTATION.ppt
VHDL-PRESENTATION.pptVHDL-PRESENTATION.ppt
VHDL-PRESENTATION.ppt
 
Basics of data communications.pptx
Basics of data communications.pptxBasics of data communications.pptx
Basics of data communications.pptx
 
CPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptxCPLD & FPGA Architectures and applictionsplications.pptx
CPLD & FPGA Architectures and applictionsplications.pptx
 
Transient response of RC , RL circuits with step input
Transient response of RC , RL circuits  with step inputTransient response of RC , RL circuits  with step input
Transient response of RC , RL circuits with step input
 
CISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURESCISC & RISC ARCHITECTURES
CISC & RISC ARCHITECTURES
 
Lect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURELect 4 ARM PROCESSOR ARCHITECTURE
Lect 4 ARM PROCESSOR ARCHITECTURE
 
Lect 3 ARM PROCESSOR ARCHITECTURE
Lect 3  ARM PROCESSOR ARCHITECTURE Lect 3  ARM PROCESSOR ARCHITECTURE
Lect 3 ARM PROCESSOR ARCHITECTURE
 
Microprocessor Architecture 4
Microprocessor Architecture  4Microprocessor Architecture  4
Microprocessor Architecture 4
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Microprocessor Architecture-III
Microprocessor Architecture-IIIMicroprocessor Architecture-III
Microprocessor Architecture-III
 
LECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORSLECT 1: ARM PROCESSORS
LECT 1: ARM PROCESSORS
 
Microprocessor architecture II
Microprocessor architecture   IIMicroprocessor architecture   II
Microprocessor architecture II
 

Recently uploaded

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 

Recently uploaded (20)

A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Data flow model -Lecture-4

  • 1. Digital Design Using Verilog -For Absolute Beginners LECTURE4 :DATA FLOW MODELLING
  • 2. Introduction-Data Flow Modelling •For simple circuits, the gate-level modeling approach works fine because the number of gates is limited and the designer can instantiate and connect every gate individually. •Also, the gate-level modeling is very intuitive to a designer with a basic knowledge of digital logic design. •But , in complex designs where the number of gates is very large it is not the case. (that easy) •So, for efficient designing, the designers prefer a higher level of abstraction than gate level .
  • 3. contd • An important point here is, as the designer is aware of how data flows between hard ware components (Registers) and how data is being processed in the design, this model is more convenient to the designers. • Another reason for importance of Data flow modelling is the unprecedented growth in the gate density on a chip which made the Gate level modelling very complicated. • Also, presently automated tools are readily available, to create a gate level circuit from data flow design description easily.(This process is called Synthesis).
  • 4. contd.. • This Data Flow model is also known as Continuous Assignment model. • This type of modelling or style is more suitable for combinational logic circuits where clock is not involved as any control signal . • As the output of a logic gate is continuously driving the input of another gate ,it is popularly known as Continuous assignment model. • The Assignment statement starts with the keyword “assign” 17 June 2020 4yayavaram@yahoo.com
  • 5. Continuous Assignments • A continuous assignment is the most basic statement in dataflow modeling, used to drive a value onto a net. • This assignment replaces gates in the description of the circuit and describes the circuit at a higher level of abstraction. • The assignment statement starts with the keyword assign. • For ex: assign A = B | C ( B OR C). • Similarly A = B & C • Here the assignment is continuously active. 17 June 2020 5yayavaram@yahoo.com
  • 6. Contd • The assign keyword creates a static binding between RHS and LHS of the above expressions. • So, w.r.t simulation, the output is continuously active. i.e Continuous assignments are always active. • The assignment expression is evaluated as soon as one of the right-hand-side operands changes . • The operands on the right-hand side can be registers or nets or function calls. Registers or nets can be scalars or vectors. 17 June 2020 6yayavaram@yahoo.com
  • 7. contd • The left hand side of an assignment must always be a scalar or vector net or a concatenation of scalar and vector nets. It cannot be a scalar or vector register. • Here net and Reg are a kind of data types. • In a simple terminology Nets represent connection between components. Ex: wire B; • Nets must be continuously driven and are used model connections between continuous assignments & instantiations. 17 June 2020 7yayavaram@yahoo.com
  • 8. contd • Where as the Reg(Register) retains the last value assigned to it until another assignment statement changes their value. • Its often used to represent storage elements. • Net and Register data types can be declared as vectors (multiple bit width). • For ex: wire [3:0] a; • wire[31:0]b; • reg[7:0] c; • reg[31:0] d; 17 June 2020 8yayavaram@yahoo.com
  • 9. Ex 1: HALF ADDER • module Half_ adder(s,c,a,b); input a , b; // Declare input Ports output s, c; // Declare out ports assign s = a ^ b; // assign statement for x-or assign c= a & b; // assign statement for logical and endmodule. 17 June 2020 9yayavaram@yahoo.com
  • 10. Ex 2: Multiplexer • The block diagram of Mux is shown below. 17 June 2020 10yayavaram@yahoo.com
  • 11. contd • The out put of Mux is here S is the select line and A,B are inputs. • Here two logical ‘and’ operations, one NOT operation and one OR operations are involved. • Using the assign statements the Verilog can be written . 17 June 2020 11yayavaram@yahoo.com
  • 12. Verilog code-Mux module mymux2_1(A,B,S,Y); output y; input A,B,S; assign Y= (A &(~S) | (B &S)); endmodule In the above code, & denotes logical ‘and’, ~ Denotes not , | denotes logical or operations. 17 June 2020 12yayavaram@yahoo.com
  • 13. Verilog code-Mux(Aliter) The same code can also be written by another simple method shown below. module mymux2_1(A,B,S,Y); output Y; input A,B,S; assign Y= S ? B:A; endmodule Note: here ? is the conditional Operator. Y = B when S=1 else Y=A. (This is a ternary operator) 17 June 2020 13yayavaram@yahoo.com
  • 14. Conditional operator (?) • ? Is a conditional operator which is a very useful ternary operator. • The conditional operator(? :) takes three operands. • Usage is ”condition-expr ? true-expr : false-expr ;” • The condition expression (condition-expr ) is first evaluated. • If the result is true (logical 1), then the true-expr is evaluated. If the result is false (logical 0), then the false-expression is evaluated. 17 June 2020 14yayavaram@yahoo.com
  • 15. Ex 3: Full Adder • Full adder has three input bits and two output bits sum and carry-out as shown in the diagram below. • In the diagram A, B, Cin are inputs and Sum & Cout are outputs. 17 June 2020 15yayavaram@yahoo.com
  • 16. Verilog code-Full Adder module myFA1(S,Cout,A,B,Cin); //Port declaration output S,Cout; input A,B,Cin; assign S= (A^B^Cin); //x-or operation assign Cout = (A&B | B & Cin | Cin & A); endmodule 17 June 2020 16yayavaram@yahoo.com
  • 17. Full Adder -16 bit module myHA_16(S,Cout,A,B,Cin); output [15:0]S; output Cout ; input [15:0]A ; //here A,B ,S are defined as wire input [15:0] B; input Cin ; assign S[15:0] = A[15:0]^B[15:0]^Cin ; assign Cout = A[15:0]&B[15:0] | B[15:0]&Cin | Cin & A[15:0]; endmodule17 June 2020 17yayavaram@yahoo.com
  • 18. 2-4 Decoder with Enable • Decoder is a combinational circuit that has ‘n’ input lines and maximum of 2n output lines. • The diagram shows a 2 to 4 Decoder with two inputs A & B , an enable pin E and four outputs D3,D2,D1,D0 . 17 June 2020 18yayavaram@yahoo.com
  • 19. contd • The working of the decoder can be under stood from the truth table shown below. 17 June 2020 19yayavaram@yahoo.com
  • 20. Ex: 2 to 4 Line Decoder • module decoder2_4 (A,B,E,D); input A,B,E; output [3:0]D; assign D[3] =~(~A & ~B & ~E); assign D[2] =~(~A & B & ~E); assign D[1] =~( A & ~B & ~E); assign D[0] =~( A & B & ~E); endmodule 17 June 2020 20yayavaram@yahoo.com
  • 21. Ex: Half Subtractor • The diagram below shows the Half Subtractor.It has two inputs .A & B and two outputs Difference (D) and borrow(B). • Difference is given by = A ^ B • Borrow is given by Bo = 17 June 2020 21yayavaram@yahoo.com
  • 22. Verilog Code • module half_sub(D,Bo,A,B); input A; input B; output D, Bo; assign D = A ^ B ; • assign borrow=(~A)&B; • endmodule 17 June 2020 22yayavaram@yahoo.com
  • 23. Full Subtractor • Similar to Full adder, Full subtractor has three input bits and two output bits, Difference and Borrow. • The logic diagram is shown below. 17 June 2020 23yayavaram@yahoo.com
  • 24. contd • In the diagram A,B,C are inputs ;and D and Bo are outputs. • The Difference of the Full subtractor is given by • D = A^(B^C) • Bo =(B&C)|(A&(B^C)’) 17 June 2020 24yayavaram@yahoo.com
  • 25. Verilog Code • module full_sub (D,Bo,A,B,C); input A,B,C; output D, Bo; assign X = B^C; • assign D = A ^ X; • assign N =~ C; • assign Y=B & N; • assign N1 =~ X; • assign z = A & N1; • assign Bo = Y | z; • endmodule 17 June 2020 25yayavaram@yahoo.com
  • 26. Verilog Code(Another way) From the Block Diagram the assignment model is • module full_sub (D,Bo,A,B,C); input A,B,C; output D, Bo; assign D = A ^ (B^C); assign Bo = B & C| (A&(B^C)’); • endmodule 17 June 2020 26yayavaram@yahoo.com
  • 27. THANQ FOR WATCHING PATIENTLY 17 June 2020 27yayavaram@yahoo.com