SlideShare a Scribd company logo
1 of 16
Download to read offline
T.Y.B.Sc.(Etx)
Advanced Digital System Design:
Unit 2.Verilog Hardware
Description Language
-Prof.Vandana Pagar
Assistant professor,
MIT ACSC
AboutThis Unit
 Importance of HDL’s, features ofVerilog HDL, Overview of
Digital Design withVerilog HDL,
 Hierarchical modeling concepts, Basic concepts ofVerilog-
Operators, comments, Number
 specifications, strings, Identifiers& keywords, Data types,
system tasks & Compiler Directives, Modules& ports.
 Gate level Modeling- Gate types, Gate delays
 Data flow modeling- Continuous Assignments, Delays
expression, operators & operands
 Behavioral Modeling- Structured Procedures, Procedural
Assignments,Timing Controls, Conditional
 statements, Multiway Branching, Loops
 Examples ofVerilog Design- Multiplexer, Demultiplexer,
Encoder, Decoder, Half Adder, Full Adder,
 Subtractor, Flip Flop, Counter, and Shift register.
Learning outcomes:
Basic concepts ofVerilog-
 Operators
 Whitespace
 comments
 Number specifications:
➢Sized numbers
➢Unsized Numbers
➢Negative Numbers
Basic concepts ofVerilog-
Whitespace
➢Blank spaces b ,
➢ tabs t and
➢newlines n
Whitespace is ignored byVerilog except
when it separates tokens.Whitespace is not
ignored in strings.
Comments
 Comments can be inserted in the code
for readability and documentation.
There are two ways to write comments.
 A one-line comment starts with "//".
Verilog skips from that point to the end
of line.
 A multiple-line comment starts with
"/* and ends with "*/".
Multiple-line comments cannot be nested
Operators
 Operators are of three types,
 unary, binary, and ternary.
 Unary operators precede the operand.
 Binary operators appear between two operands.
 Ternary operators have two separate operators
that separate three operands.
 a = - b; // - is a unary operator. b is the operand
 a = b && c; // && is a binary operator. b and c are
operands
 a = b ? c : d; // ?: is a ternary operator. b, c and d
are operands
Verilog Operators
 Arithmetic Operators
 C =A+ B;
 puts the three-bit sum of A plus B into C,
while
 C =A− B;
 puts the difference of A and B into C.The
operation
 C=A*B
 C = −A;
 places the 2’s complement of A into C.
Number Specification:
 Two types of number specification inVerilog:
 sized and unsized
Sized numbers :
Sized numbers are represented as
<size> ‘ <base format> <number>.
<size> is written only in decimal and specifies the number of bits in the
number.
Legal base formats are:
decimal: ('d or 'D),
hexadecimal : ('h or 'H),
binary : ('b or 'B)
octal : ('0 or '0).
The number is specified as consecutive digits from O,1,2,3, 4,5, 6, 7, 8, 9, a, b, c,
d, e, f. Only a subset of these digits is legal for a particular base.
Note: Uppercase letters are legal for number specification.
 4'b1111 //This is a 4-bit binary number
 12'h D6F //This is a 12-bit hexadecimal number
 16'd255 //This is a 16-bit decimal number.
Unsized numbers:
 Numbers that are specified without a <base
format> specification are decimal numbers by
default.
 Numbers that are written without a <size>
specification have a default number of bits that is
simulator- and machine-specific (must be at
least32).
 23456 // This is a 32-bit decimal number
 'hC3 //This is a 32-bit hexadecimal number
 '021 // This is a 32-bit octal number
X or z values
 Verilog has two symbols for unknown and
high impedance values.
 These values are very important for
modeling real circuits.
 An unknown value is denoted by an X.
 A high impedance value is denoted by z.
 12'h13x //This is a 12-bit hex number; 4 least
significant bits unknown
 6'hx //This is a 6-bit unknown hex number
 32'bz //This is a 32-bit high impedance number
 An X or z sets four bits for a number in
the hexadecimal base, three bits for a
number in the octal base, and one bit for
a number in the binary base.
 If the most significant bit of a number is of
X, or z, the number is automatically
extended to fill the most significant bits,
respectively, with 0, X, or z.
 This makes it easy to assign X or z to
whole vector. If the most significant digit
is I, then it is also zero extended.
Negative numbers:
 Negative numbers can be specified by
putting a minus sign before the size for
a constant number.
 Size constants are always positive. It is
illegal to have a minus sign between
<base format> and <number>.
 -6'd3 // 6-bit negative decimal
number stored as 2's
complement of 3
 4'd-2 // Illegal specification
 Underscore characters and question
marks An underscore character "-" is
allowed anywhere in a number except
the first character.
 Underscore characters are allowed
only to improve readability of numbers
and are ignored byVerilog.
 A question mark "?" is theVerilog HDL
alternative for z in the context of
numbers.
 12'b1111_0000_1010 // Use of
underline characters for readability
 4'b10?? // Equivalent of a 4'blOzz
References:
 Verilog HDL A guide to digital design & synthesis By Samir Palnitkar,
Pearson Second Edition
 Fundamental of digital logic with Verilog By Stephen Brown, Zvonko
Vranesic, Tata McGraw Hill
THANKYOU

More Related Content

What's hot

Error detection and correction codes
Error detection and correction codesError detection and correction codes
Error detection and correction codesGargiKhanna1
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generationIffat Anjum
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationAkshaya Arunan
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1Shashwat Shriparv
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16John Todora
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converterUshaswini Chowdary
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparatorBilal Amjad
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Bitwise Operations in Programming
Bitwise Operations in ProgrammingBitwise Operations in Programming
Bitwise Operations in ProgrammingSvetlin Nakov
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Code generator
Code generatorCode generator
Code generatorTech_MX
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationRamchandraRegmi
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codesRevathi Subramaniam
 
Manoch1raw 160512091436
Manoch1raw 160512091436Manoch1raw 160512091436
Manoch1raw 160512091436marangburu42
 

What's hot (20)

Error detection and correction codes
Error detection and correction codesError detection and correction codes
Error detection and correction codes
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
 
Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparator
 
Octal encoding
Octal encodingOctal encoding
Octal encoding
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Bitwise Operations in Programming
Bitwise Operations in ProgrammingBitwise Operations in Programming
Bitwise Operations in Programming
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Code generator
Code generatorCode generator
Code generator
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
 
Manoch1raw 160512091436
Manoch1raw 160512091436Manoch1raw 160512091436
Manoch1raw 160512091436
 
Back patching
Back patchingBack patching
Back patching
 
C language programming
C language programmingC language programming
C language programming
 

Similar to Vhdl introduction

Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptxSyedAzim6
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLE2MATRIX
 
Learn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITLearn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITASIT
 
Programming in c
Programming in cProgramming in c
Programming in cvineet4523
 
Basic concepts in Verilog HDL
Basic concepts in Verilog HDLBasic concepts in Verilog HDL
Basic concepts in Verilog HDLanand hd
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfAsst.prof M.Gokilavani
 
C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)guest58c84c
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)jahanullah
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorialMohit Saini
 
data representation
 data representation data representation
data representationHaroon_007
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
Memory management of datatypes
Memory management of datatypesMemory management of datatypes
Memory management of datatypesMonika Sanghani
 

Similar to Vhdl introduction (20)

DDUV.pdf
DDUV.pdfDDUV.pdf
DDUV.pdf
 
Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptx
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
 
Fpga 05-verilog-programming
Fpga 05-verilog-programmingFpga 05-verilog-programming
Fpga 05-verilog-programming
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
 
Learn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITLearn C LANGUAGE at ASIT
Learn C LANGUAGE at ASIT
 
Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
 
Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
 
Verilog HDL- 2
Verilog HDL- 2Verilog HDL- 2
Verilog HDL- 2
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Basic concepts in Verilog HDL
Basic concepts in Verilog HDLBasic concepts in Verilog HDL
Basic concepts in Verilog HDL
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
 
C Sharp Nagina (1)
C Sharp Nagina (1)C Sharp Nagina (1)
C Sharp Nagina (1)
 
C Sharp Jn (1)
C Sharp Jn (1)C Sharp Jn (1)
C Sharp Jn (1)
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 
data representation
 data representation data representation
data representation
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
Memory management of datatypes
Memory management of datatypesMemory management of datatypes
Memory management of datatypes
 

More from VandanaPagar1

Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptxVandanaPagar1
 
Networking Technologies in IOT.pdf
Networking Technologies in IOT.pdfNetworking Technologies in IOT.pdf
Networking Technologies in IOT.pdfVandanaPagar1
 
IoT_application.pptx
IoT_application.pptxIoT_application.pptx
IoT_application.pptxVandanaPagar1
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modellingVandanaPagar1
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes VandanaPagar1
 

More from VandanaPagar1 (7)

Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
 
Cloud-topology.pdf
Cloud-topology.pdfCloud-topology.pdf
Cloud-topology.pdf
 
Networking Technologies in IOT.pdf
Networking Technologies in IOT.pdfNetworking Technologies in IOT.pdf
Networking Technologies in IOT.pdf
 
IoT_application.pptx
IoT_application.pptxIoT_application.pptx
IoT_application.pptx
 
Logic Synthesis
Logic SynthesisLogic Synthesis
Logic Synthesis
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
 
Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes Digital Electronics- Number systems & codes
Digital Electronics- Number systems & codes
 

Recently uploaded

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
 
(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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
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
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
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
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
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
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

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
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
(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
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
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
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
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
 
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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
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
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
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
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

Vhdl introduction

  • 1. T.Y.B.Sc.(Etx) Advanced Digital System Design: Unit 2.Verilog Hardware Description Language -Prof.Vandana Pagar Assistant professor, MIT ACSC
  • 2. AboutThis Unit  Importance of HDL’s, features ofVerilog HDL, Overview of Digital Design withVerilog HDL,  Hierarchical modeling concepts, Basic concepts ofVerilog- Operators, comments, Number  specifications, strings, Identifiers& keywords, Data types, system tasks & Compiler Directives, Modules& ports.  Gate level Modeling- Gate types, Gate delays  Data flow modeling- Continuous Assignments, Delays expression, operators & operands  Behavioral Modeling- Structured Procedures, Procedural Assignments,Timing Controls, Conditional  statements, Multiway Branching, Loops  Examples ofVerilog Design- Multiplexer, Demultiplexer, Encoder, Decoder, Half Adder, Full Adder,  Subtractor, Flip Flop, Counter, and Shift register.
  • 3. Learning outcomes: Basic concepts ofVerilog-  Operators  Whitespace  comments  Number specifications: ➢Sized numbers ➢Unsized Numbers ➢Negative Numbers
  • 4. Basic concepts ofVerilog- Whitespace ➢Blank spaces b , ➢ tabs t and ➢newlines n Whitespace is ignored byVerilog except when it separates tokens.Whitespace is not ignored in strings.
  • 5. Comments  Comments can be inserted in the code for readability and documentation. There are two ways to write comments.  A one-line comment starts with "//". Verilog skips from that point to the end of line.  A multiple-line comment starts with "/* and ends with "*/". Multiple-line comments cannot be nested
  • 6. Operators  Operators are of three types,  unary, binary, and ternary.  Unary operators precede the operand.  Binary operators appear between two operands.  Ternary operators have two separate operators that separate three operands.  a = - b; // - is a unary operator. b is the operand  a = b && c; // && is a binary operator. b and c are operands  a = b ? c : d; // ?: is a ternary operator. b, c and d are operands
  • 7. Verilog Operators  Arithmetic Operators  C =A+ B;  puts the three-bit sum of A plus B into C, while  C =A− B;  puts the difference of A and B into C.The operation  C=A*B  C = −A;  places the 2’s complement of A into C.
  • 8.
  • 9. Number Specification:  Two types of number specification inVerilog:  sized and unsized Sized numbers : Sized numbers are represented as <size> ‘ <base format> <number>. <size> is written only in decimal and specifies the number of bits in the number. Legal base formats are: decimal: ('d or 'D), hexadecimal : ('h or 'H), binary : ('b or 'B) octal : ('0 or '0). The number is specified as consecutive digits from O,1,2,3, 4,5, 6, 7, 8, 9, a, b, c, d, e, f. Only a subset of these digits is legal for a particular base. Note: Uppercase letters are legal for number specification.  4'b1111 //This is a 4-bit binary number  12'h D6F //This is a 12-bit hexadecimal number  16'd255 //This is a 16-bit decimal number.
  • 10. Unsized numbers:  Numbers that are specified without a <base format> specification are decimal numbers by default.  Numbers that are written without a <size> specification have a default number of bits that is simulator- and machine-specific (must be at least32).  23456 // This is a 32-bit decimal number  'hC3 //This is a 32-bit hexadecimal number  '021 // This is a 32-bit octal number
  • 11. X or z values  Verilog has two symbols for unknown and high impedance values.  These values are very important for modeling real circuits.  An unknown value is denoted by an X.  A high impedance value is denoted by z.  12'h13x //This is a 12-bit hex number; 4 least significant bits unknown  6'hx //This is a 6-bit unknown hex number  32'bz //This is a 32-bit high impedance number
  • 12.  An X or z sets four bits for a number in the hexadecimal base, three bits for a number in the octal base, and one bit for a number in the binary base.  If the most significant bit of a number is of X, or z, the number is automatically extended to fill the most significant bits, respectively, with 0, X, or z.  This makes it easy to assign X or z to whole vector. If the most significant digit is I, then it is also zero extended.
  • 13. Negative numbers:  Negative numbers can be specified by putting a minus sign before the size for a constant number.  Size constants are always positive. It is illegal to have a minus sign between <base format> and <number>.  -6'd3 // 6-bit negative decimal number stored as 2's complement of 3  4'd-2 // Illegal specification
  • 14.  Underscore characters and question marks An underscore character "-" is allowed anywhere in a number except the first character.  Underscore characters are allowed only to improve readability of numbers and are ignored byVerilog.  A question mark "?" is theVerilog HDL alternative for z in the context of numbers.  12'b1111_0000_1010 // Use of underline characters for readability  4'b10?? // Equivalent of a 4'blOzz
  • 15. References:  Verilog HDL A guide to digital design & synthesis By Samir Palnitkar, Pearson Second Edition  Fundamental of digital logic with Verilog By Stephen Brown, Zvonko Vranesic, Tata McGraw Hill