SlideShare a Scribd company logo
1
Verilog HDLVerilog HDL
Lecture 7
2
Logical Operators
• && → logical AND
• | | → logical OR
• ! → logical NOT
• Operands evaluated to ONE bit value: 0, 1 or x
• Result is ONE bit value: 0, 1 or x
• A= 6; A&&B → 1&&0 → 0
• B = 0; A | | !B → 1| |1 → 1
• C= x; C | | B → x | | 0 → x, C&&B = 0
Lecture 7
3
Bitwise Operators
• & → bitwise AND
• | → bitwise OR
• ~ → bitwise NOT
• ^ → bitwise XOR
• ~^ or ^~ → bitwise XNOR
• Operation on bit by bit basis
Lecture 7
4
Bitwise Operators
•
Lecture 7
5
Reduction Operators
• & → AND
• | → OR
• ~& → NAND
• ~| → NOR
• ^ → XOR
• ~^ or ^~ → XNOR
• One multi-bit operand → One single-bit result
• a = 4’b1001;
• c = |a ; // c = 1|0|0|1 = 1
Lecture 7
6
Shift Operators
• >> → shift right
• << → shift left
• Result is same size as first operand, always zero filled
• a = 4’b1010;
• d = a>>2; //d= 0010
• c = a<<1; //c= 0100
Lecture 7
7
Concatenation Operator
• {op1, op2, ..} → concatenates op1, op2, .. to single
number
• Operands must be sized !!
reg a;
reg [2:0] b, c;
..
a = 1’b 1;
b = 3’b 010;
c = 3’b 101;
catx = {a, b, c}; //catx = 1_010_101
Lecture 7
8
Concatenation Operator
caty = {b, 2’b11, a};//caty = 010_11_1
catz = {b, 1}; // WRONG !!
• Replication ..
catr = {4{a}, b, 2{c}};
// catr = 1111_010_101101
Lecture 7
9
Example of Replication
We want to multiply A and B 5-bits numbers.
Lecture 7
10
Replication: Verilog Code of Multiplier
module mul_5x5(A, B, mul_out); // Multiplier Unsigned X
Unsigned Number
input [4:0] A, B ;
output [9:0] mul_out ;
wire [4:0] pp0, pp1, pp2, pp3, pp4 ;
wire [9:0] mul_out ;
assign ppo = A & {5{B[0]}} ;
assign pp1 = A & {5{B[1]}} ;
assign pp2 = A & {5{B[2]}} ;
assign pp3 = A & {5{B[3]}} ;
assign pp4 = A & {5{B[4]}} ;
assign mul_out = pp0 + {pp1, 1’b0} + {pp2, 2’b0} + {pp3,
3’b0} +{pp4, 4’b0} ;
endmodule
Lecture 7
11
Relational Operators
• > → greater than
• < → less than
• >= → greater or equal than
• <= → less or equal than
• Result is one bit value: 0, 1 or x
1 > 0 → 1
’b1x1 <= 0 → x
10 < z → x
Lecture 7
12
Equality Operators
• == → logical equality
• != → logical inequality
• === → case equality
• !== → case inequality
• 4’b 1z0x == 4’b 1z0x → x
• 4’b 1z0x != 4’b 1z0x → x
• 4’b 1z0x === 4’b 1z0x → 1
• 4’b 1z0x !== 4’b 1z0x → 0
Lecture 7
13
Conditional Operator
• cond_expr ? true_expr : false_expr
• Like a 2-to-1 mux ..
Lecture 7
14
Arithmetic Operators
• +, -, *, /, %
• If any operand is x the result is x
• Negative registers:
• regs can be assigned negative but are
treated as unsigned
reg [15:0] regA;
Lecture 7
15
Arithmetic Operators
regA = -16’d12;
//stored as 216
-12 = 65524
regA/3 evaluates to 21841
•Negative integers:
• can be assigned negative values
• different treatment depending on base
specification or not
Lecture 7
16
Arithmetic Operators
reg [15:0] regA;
integer intA;
..
intA = -12/3;
//evaluates to –4 (no base
spec)
intA = -’d12/3;
//evaluates to 1431655761
(base spec) Lecture 7
17
Operator Precedence
Lecture 7

More Related Content

What's hot

PAL And PLA ROM
PAL And PLA ROMPAL And PLA ROM
PAL And PLA ROM
RONAK SUTARIYA
 
finfet tsmc.pdf
finfet tsmc.pdffinfet tsmc.pdf
finfet tsmc.pdf
MANSISHEKHAWAT3
 
Using polysilicon as a gate contact instead of metal in CMOS
Using polysilicon as a gate  contact instead of metal in CMOSUsing polysilicon as a gate  contact instead of metal in CMOS
Using polysilicon as a gate contact instead of metal in CMOS
Eng Ansam Hadi
 
Double patterning for 32nm and beyond
Double patterning for 32nm and beyondDouble patterning for 32nm and beyond
Double patterning for 32nm and beyond
Manikandan Sampathkumar
 
Synchronous and asynchronous clock
Synchronous and asynchronous clockSynchronous and asynchronous clock
Synchronous and asynchronous clock
Nallapati Anindra
 
Introduction to fpga synthesis tools
Introduction to fpga synthesis toolsIntroduction to fpga synthesis tools
Introduction to fpga synthesis tools
Hossam Hassan
 
Design of two stage OP AMP
Design of two stage OP AMPDesign of two stage OP AMP
Design of two stage OP AMP
azmathmoosa
 
Logic synthesis,flootplan&placement
Logic synthesis,flootplan&placementLogic synthesis,flootplan&placement
Logic synthesis,flootplan&placement
shaik sharief
 
Verilog
VerilogVerilog
Verilog
abkvlsi
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devicesAmmara Javed
 
VLSI-Physical Design- Tool Terminalogy
VLSI-Physical Design- Tool TerminalogyVLSI-Physical Design- Tool Terminalogy
VLSI-Physical Design- Tool TerminalogyMurali Rai
 
Stick digram by Euler Approach
Stick digram by Euler ApproachStick digram by Euler Approach
Stick digram by Euler Approach
Sudhanshu Janwadkar
 
Double Patterning (4/2 update)
Double Patterning (4/2 update)Double Patterning (4/2 update)
Double Patterning (4/2 update)Danny Luk
 
Clk-to-q delay, library setup and hold time
Clk-to-q delay, library setup and hold timeClk-to-q delay, library setup and hold time
Clk-to-q delay, library setup and hold time
VLSI SYSTEM Design
 
GUI for DRV fix in ICC2
GUI for DRV fix in ICC2GUI for DRV fix in ICC2
GUI for DRV fix in ICC2
Prashanth Chokkarapu
 
4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow
Maurizio Donna
 

What's hot (20)

PAL And PLA ROM
PAL And PLA ROMPAL And PLA ROM
PAL And PLA ROM
 
finfet tsmc.pdf
finfet tsmc.pdffinfet tsmc.pdf
finfet tsmc.pdf
 
Asic pd
Asic pdAsic pd
Asic pd
 
Using polysilicon as a gate contact instead of metal in CMOS
Using polysilicon as a gate  contact instead of metal in CMOSUsing polysilicon as a gate  contact instead of metal in CMOS
Using polysilicon as a gate contact instead of metal in CMOS
 
Booth Multiplier
Booth MultiplierBooth Multiplier
Booth Multiplier
 
Fpga design flow
Fpga design flowFpga design flow
Fpga design flow
 
Double patterning for 32nm and beyond
Double patterning for 32nm and beyondDouble patterning for 32nm and beyond
Double patterning for 32nm and beyond
 
Synchronous and asynchronous clock
Synchronous and asynchronous clockSynchronous and asynchronous clock
Synchronous and asynchronous clock
 
Introduction to fpga synthesis tools
Introduction to fpga synthesis toolsIntroduction to fpga synthesis tools
Introduction to fpga synthesis tools
 
Pass transistor logic
Pass transistor logicPass transistor logic
Pass transistor logic
 
Design of two stage OP AMP
Design of two stage OP AMPDesign of two stage OP AMP
Design of two stage OP AMP
 
Logic synthesis,flootplan&placement
Logic synthesis,flootplan&placementLogic synthesis,flootplan&placement
Logic synthesis,flootplan&placement
 
Verilog
VerilogVerilog
Verilog
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devices
 
VLSI-Physical Design- Tool Terminalogy
VLSI-Physical Design- Tool TerminalogyVLSI-Physical Design- Tool Terminalogy
VLSI-Physical Design- Tool Terminalogy
 
Stick digram by Euler Approach
Stick digram by Euler ApproachStick digram by Euler Approach
Stick digram by Euler Approach
 
Double Patterning (4/2 update)
Double Patterning (4/2 update)Double Patterning (4/2 update)
Double Patterning (4/2 update)
 
Clk-to-q delay, library setup and hold time
Clk-to-q delay, library setup and hold timeClk-to-q delay, library setup and hold time
Clk-to-q delay, library setup and hold time
 
GUI for DRV fix in ICC2
GUI for DRV fix in ICC2GUI for DRV fix in ICC2
GUI for DRV fix in ICC2
 
4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow4.FPGA for dummies: Design Flow
4.FPGA for dummies: Design Flow
 

Viewers also liked

Sec3 chapter5 bonding singapore_slideshare
Sec3 chapter5 bonding singapore_slideshareSec3 chapter5 bonding singapore_slideshare
Sec3 chapter5 bonding singapore_slideshareAdrian Peeris
 
Bmc social studies_chapter3_healthcare(spore&uk systems)
Bmc social studies_chapter3_healthcare(spore&uk systems)Bmc social studies_chapter3_healthcare(spore&uk systems)
Bmc social studies_chapter3_healthcare(spore&uk systems)Adrian Peeris
 
Florante at laura
Florante at lauraFlorante at laura
Florante at laura
RubyClaire
 
Sec3 english language_comprehension(thesummaryqn)
Sec3 english language_comprehension(thesummaryqn)Sec3 english language_comprehension(thesummaryqn)
Sec3 english language_comprehension(thesummaryqn)
Adrian Peeris
 
Poap de 2º eso a 3º eso 2016 2017
Poap de 2º eso  a 3º eso 2016 2017Poap de 2º eso  a 3º eso 2016 2017
Poap de 2º eso a 3º eso 2016 2017
Panchobordon
 
Singular and plural nouns for first graders
Singular and plural nouns for first gradersSingular and plural nouns for first graders
Singular and plural nouns for first graders
Me-an Cupo
 
Bmc social studies_chapter2b_governance in singapore(poppolicies)
Bmc social studies_chapter2b_governance in singapore(poppolicies)Bmc social studies_chapter2b_governance in singapore(poppolicies)
Bmc social studies_chapter2b_governance in singapore(poppolicies)Adrian Peeris
 
Bmc cold war lect 4_cuban_missilecrisis
Bmc cold war lect 4_cuban_missilecrisisBmc cold war lect 4_cuban_missilecrisis
Bmc cold war lect 4_cuban_missilecrisisAdrian Peeris
 
Onset and rime For First Graders
Onset and rime For First GradersOnset and rime For First Graders
Onset and rime For First Graders
Me-an Cupo
 
Rules in forming the plural of noun (grade 1-2)
Rules in forming the plural of noun (grade 1-2)Rules in forming the plural of noun (grade 1-2)
Rules in forming the plural of noun (grade 1-2)
Me-an Cupo
 
Sec3 chapter6 diplomacy & deterrence(singapore)_slideshare
Sec3 chapter6 diplomacy & deterrence(singapore)_slideshareSec3 chapter6 diplomacy & deterrence(singapore)_slideshare
Sec3 chapter6 diplomacy & deterrence(singapore)_slideshareAdrian Peeris
 
Making inferences
Making inferencesMaking inferences
Making inferences
Me-an Cupo
 
Kinds of nouns according to number (grade 1)
Kinds of nouns according to number (grade 1)Kinds of nouns according to number (grade 1)
Kinds of nouns according to number (grade 1)
Me-an Cupo
 
Elements of the Story: Problem and solution
Elements of the Story: Problem and solution Elements of the Story: Problem and solution
Elements of the Story: Problem and solution
Me-an Cupo
 
Bmc o&n english_language_composition(situational writing)(formal letter)_slid...
Bmc o&n english_language_composition(situational writing)(formal letter)_slid...Bmc o&n english_language_composition(situational writing)(formal letter)_slid...
Bmc o&n english_language_composition(situational writing)(formal letter)_slid...
Adrian Peeris
 

Viewers also liked (16)

Sec3 chapter5 bonding singapore_slideshare
Sec3 chapter5 bonding singapore_slideshareSec3 chapter5 bonding singapore_slideshare
Sec3 chapter5 bonding singapore_slideshare
 
Bmc social studies_chapter3_healthcare(spore&uk systems)
Bmc social studies_chapter3_healthcare(spore&uk systems)Bmc social studies_chapter3_healthcare(spore&uk systems)
Bmc social studies_chapter3_healthcare(spore&uk systems)
 
Florante at laura
Florante at lauraFlorante at laura
Florante at laura
 
Sec3 english language_comprehension(thesummaryqn)
Sec3 english language_comprehension(thesummaryqn)Sec3 english language_comprehension(thesummaryqn)
Sec3 english language_comprehension(thesummaryqn)
 
Poap de 2º eso a 3º eso 2016 2017
Poap de 2º eso  a 3º eso 2016 2017Poap de 2º eso  a 3º eso 2016 2017
Poap de 2º eso a 3º eso 2016 2017
 
Bmc cold war lect 3
Bmc cold war lect 3Bmc cold war lect 3
Bmc cold war lect 3
 
Singular and plural nouns for first graders
Singular and plural nouns for first gradersSingular and plural nouns for first graders
Singular and plural nouns for first graders
 
Bmc social studies_chapter2b_governance in singapore(poppolicies)
Bmc social studies_chapter2b_governance in singapore(poppolicies)Bmc social studies_chapter2b_governance in singapore(poppolicies)
Bmc social studies_chapter2b_governance in singapore(poppolicies)
 
Bmc cold war lect 4_cuban_missilecrisis
Bmc cold war lect 4_cuban_missilecrisisBmc cold war lect 4_cuban_missilecrisis
Bmc cold war lect 4_cuban_missilecrisis
 
Onset and rime For First Graders
Onset and rime For First GradersOnset and rime For First Graders
Onset and rime For First Graders
 
Rules in forming the plural of noun (grade 1-2)
Rules in forming the plural of noun (grade 1-2)Rules in forming the plural of noun (grade 1-2)
Rules in forming the plural of noun (grade 1-2)
 
Sec3 chapter6 diplomacy & deterrence(singapore)_slideshare
Sec3 chapter6 diplomacy & deterrence(singapore)_slideshareSec3 chapter6 diplomacy & deterrence(singapore)_slideshare
Sec3 chapter6 diplomacy & deterrence(singapore)_slideshare
 
Making inferences
Making inferencesMaking inferences
Making inferences
 
Kinds of nouns according to number (grade 1)
Kinds of nouns according to number (grade 1)Kinds of nouns according to number (grade 1)
Kinds of nouns according to number (grade 1)
 
Elements of the Story: Problem and solution
Elements of the Story: Problem and solution Elements of the Story: Problem and solution
Elements of the Story: Problem and solution
 
Bmc o&n english_language_composition(situational writing)(formal letter)_slid...
Bmc o&n english_language_composition(situational writing)(formal letter)_slid...Bmc o&n english_language_composition(situational writing)(formal letter)_slid...
Bmc o&n english_language_composition(situational writing)(formal letter)_slid...
 

Similar to Verilog lect 7

Assic 7th Lecture
Assic 7th LectureAssic 7th Lecture
Assic 7th Lecture
babak danyal
 
C Operators
C OperatorsC Operators
GSP 215 Entire Course NEW
GSP 215 Entire Course NEWGSP 215 Entire Course NEW
GSP 215 Entire Course NEW
shyamuopten
 
C++ Programming Basics.pptx
C++ Programming Basics.pptxC++ Programming Basics.pptx
C++ Programming Basics.pptx
ZntalemAbebe
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3rohassanie
 
3306617
33066173306617
3306617
shwetakks
 
Ruby Basics by Rafiq
Ruby Basics by RafiqRuby Basics by Rafiq
Ruby Basics by Rafiq
Rafiqdeen
 
verilog_1.ppt
verilog_1.pptverilog_1.ppt
verilog_1.ppt
HaleNurKumcuoglu
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
Neeru Mittal
 
Operators in python
Operators in pythonOperators in python
Operators in python
Prabhakaran V M
 
Reducing computational complexity of Mathematical functions using FPGA
Reducing computational complexity of Mathematical functions using FPGAReducing computational complexity of Mathematical functions using FPGA
Reducing computational complexity of Mathematical functions using FPGA
nehagaur339
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
Baileya55
 
Operators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languagesOperators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languages
AbhishekGupta692777
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
Mahmoud Samir Fayed
 
Python PCEP Logic Bit Operations
Python PCEP Logic Bit OperationsPython PCEP Logic Bit Operations
Python PCEP Logic Bit Operations
IHTMINSTITUTE
 
Matlab operators
Matlab operatorsMatlab operators
Matlab operators
Aswin Pv
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 studrohassanie
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statementsCtOlaf
 
GSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comGSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.com
claric119
 

Similar to Verilog lect 7 (20)

Assic 7th Lecture
Assic 7th LectureAssic 7th Lecture
Assic 7th Lecture
 
C Operators
C OperatorsC Operators
C Operators
 
GSP 215 Entire Course NEW
GSP 215 Entire Course NEWGSP 215 Entire Course NEW
GSP 215 Entire Course NEW
 
C++ Programming Basics.pptx
C++ Programming Basics.pptxC++ Programming Basics.pptx
C++ Programming Basics.pptx
 
FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3FP 201 Unit 2 - Part 3
FP 201 Unit 2 - Part 3
 
3306617
33066173306617
3306617
 
Ruby Basics by Rafiq
Ruby Basics by RafiqRuby Basics by Rafiq
Ruby Basics by Rafiq
 
verilog_1.ppt
verilog_1.pptverilog_1.ppt
verilog_1.ppt
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Reducing computational complexity of Mathematical functions using FPGA
Reducing computational complexity of Mathematical functions using FPGAReducing computational complexity of Mathematical functions using FPGA
Reducing computational complexity of Mathematical functions using FPGA
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
 
Operators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languagesOperators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languages
 
vlsi design using verilog presentaion 1
vlsi design using verilog   presentaion 1vlsi design using verilog   presentaion 1
vlsi design using verilog presentaion 1
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
 
Python PCEP Logic Bit Operations
Python PCEP Logic Bit OperationsPython PCEP Logic Bit Operations
Python PCEP Logic Bit Operations
 
Matlab operators
Matlab operatorsMatlab operators
Matlab operators
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 stud
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
GSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.comGSP 215 RANK Become Exceptional--gsp215rank.com
GSP 215 RANK Become Exceptional--gsp215rank.com
 

Recently uploaded

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 

Verilog lect 7

  • 2. 2 Logical Operators • && → logical AND • | | → logical OR • ! → logical NOT • Operands evaluated to ONE bit value: 0, 1 or x • Result is ONE bit value: 0, 1 or x • A= 6; A&&B → 1&&0 → 0 • B = 0; A | | !B → 1| |1 → 1 • C= x; C | | B → x | | 0 → x, C&&B = 0 Lecture 7
  • 3. 3 Bitwise Operators • & → bitwise AND • | → bitwise OR • ~ → bitwise NOT • ^ → bitwise XOR • ~^ or ^~ → bitwise XNOR • Operation on bit by bit basis Lecture 7
  • 5. 5 Reduction Operators • & → AND • | → OR • ~& → NAND • ~| → NOR • ^ → XOR • ~^ or ^~ → XNOR • One multi-bit operand → One single-bit result • a = 4’b1001; • c = |a ; // c = 1|0|0|1 = 1 Lecture 7
  • 6. 6 Shift Operators • >> → shift right • << → shift left • Result is same size as first operand, always zero filled • a = 4’b1010; • d = a>>2; //d= 0010 • c = a<<1; //c= 0100 Lecture 7
  • 7. 7 Concatenation Operator • {op1, op2, ..} → concatenates op1, op2, .. to single number • Operands must be sized !! reg a; reg [2:0] b, c; .. a = 1’b 1; b = 3’b 010; c = 3’b 101; catx = {a, b, c}; //catx = 1_010_101 Lecture 7
  • 8. 8 Concatenation Operator caty = {b, 2’b11, a};//caty = 010_11_1 catz = {b, 1}; // WRONG !! • Replication .. catr = {4{a}, b, 2{c}}; // catr = 1111_010_101101 Lecture 7
  • 9. 9 Example of Replication We want to multiply A and B 5-bits numbers. Lecture 7
  • 10. 10 Replication: Verilog Code of Multiplier module mul_5x5(A, B, mul_out); // Multiplier Unsigned X Unsigned Number input [4:0] A, B ; output [9:0] mul_out ; wire [4:0] pp0, pp1, pp2, pp3, pp4 ; wire [9:0] mul_out ; assign ppo = A & {5{B[0]}} ; assign pp1 = A & {5{B[1]}} ; assign pp2 = A & {5{B[2]}} ; assign pp3 = A & {5{B[3]}} ; assign pp4 = A & {5{B[4]}} ; assign mul_out = pp0 + {pp1, 1’b0} + {pp2, 2’b0} + {pp3, 3’b0} +{pp4, 4’b0} ; endmodule Lecture 7
  • 11. 11 Relational Operators • > → greater than • < → less than • >= → greater or equal than • <= → less or equal than • Result is one bit value: 0, 1 or x 1 > 0 → 1 ’b1x1 <= 0 → x 10 < z → x Lecture 7
  • 12. 12 Equality Operators • == → logical equality • != → logical inequality • === → case equality • !== → case inequality • 4’b 1z0x == 4’b 1z0x → x • 4’b 1z0x != 4’b 1z0x → x • 4’b 1z0x === 4’b 1z0x → 1 • 4’b 1z0x !== 4’b 1z0x → 0 Lecture 7
  • 13. 13 Conditional Operator • cond_expr ? true_expr : false_expr • Like a 2-to-1 mux .. Lecture 7
  • 14. 14 Arithmetic Operators • +, -, *, /, % • If any operand is x the result is x • Negative registers: • regs can be assigned negative but are treated as unsigned reg [15:0] regA; Lecture 7
  • 15. 15 Arithmetic Operators regA = -16’d12; //stored as 216 -12 = 65524 regA/3 evaluates to 21841 •Negative integers: • can be assigned negative values • different treatment depending on base specification or not Lecture 7
  • 16. 16 Arithmetic Operators reg [15:0] regA; integer intA; .. intA = -12/3; //evaluates to –4 (no base spec) intA = -’d12/3; //evaluates to 1431655761 (base spec) Lecture 7