SlideShare a Scribd company logo
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 codes
GargiKhanna1
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
Iffat Anjum
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
Akshaya Arunan
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
Shashwat Shriparv
 
Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
Vaagdevi College of Engineering
 
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
John Todora
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
Ushaswini Chowdary
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
Dr.DHANALAKSHMI SENTHILKUMAR
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparator
Bilal Amjad
 
Octal encoding
Octal encodingOctal encoding
Octal encoding
rajshreemuthiah
 
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 Programming
Svetlin Nakov
 
Data Representation
Data RepresentationData Representation
Data Representation
Praveen M Jigajinni
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
Shine Raj
 
Code generator
Code generatorCode generator
Code generator
Tech_MX
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
RamchandraRegmi
 
Error detection & correction codes
Error detection & correction codesError detection & correction codes
Error detection & correction codes
Revathi Subramaniam
 
Manoch1raw 160512091436
Manoch1raw 160512091436Manoch1raw 160512091436
Manoch1raw 160512091436
marangburu42
 
Back patching
Back patchingBack patching
Back patching
santhiya thavanthi
 
C language programming
C language programmingC language programming
C language programming
Vaibhav Salonia
 

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

DDUV.pdf
DDUV.pdfDDUV.pdf
DDUV.pdf
VandanaPagar1
 
Verilog Final Probe'22.pptx
Verilog Final Probe'22.pptxVerilog Final Probe'22.pptx
Verilog Final Probe'22.pptx
SyedAzim6
 
VHDL- data types
VHDL- data typesVHDL- data types
VHDL- data types
VandanaPagar1
 
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
E2MATRIX
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
E2MATRIX
 
Fpga 05-verilog-programming
Fpga 05-verilog-programmingFpga 05-verilog-programming
Fpga 05-verilog-programming
Malik Tauqir Hasan
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
sohelranasweet
 
Learn C LANGUAGE at ASIT
Learn C LANGUAGE at ASITLearn C LANGUAGE at ASIT
Learn C LANGUAGE at ASIT
ASIT
 
Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
naveendnk22
 
Mql4 manual
Mql4 manualMql4 manual
Mql4 manual
Toni Zico
 
Verilog HDL- 2
Verilog HDL- 2Verilog HDL- 2
Verilog HDL- 2
Prabhavathi P
 
Programming in c
Programming in cProgramming in c
Programming in c
vineet4523
 
Basic concepts in Verilog HDL
Basic concepts in Verilog HDLBasic concepts in Verilog HDL
Basic concepts in Verilog HDL
anand 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 .pdf
Asst.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 tutorial
Mohit Saini
 
data representation
 data representation data representation
data representation
Haroon_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 Programming
Kamal Acharya
 
Memory management of datatypes
Memory management of datatypesMemory management of datatypes
Memory management of datatypes
Monika 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.pptx
VandanaPagar1
 
Cloud-topology.pdf
Cloud-topology.pdfCloud-topology.pdf
Cloud-topology.pdf
VandanaPagar1
 
Networking Technologies in IOT.pdf
Networking Technologies in IOT.pdfNetworking Technologies in IOT.pdf
Networking Technologies in IOT.pdf
VandanaPagar1
 
IoT_application.pptx
IoT_application.pptxIoT_application.pptx
IoT_application.pptx
VandanaPagar1
 
Logic Synthesis
Logic SynthesisLogic Synthesis
Logic Synthesis
VandanaPagar1
 
VHDL- gate level modelling
VHDL- gate level modellingVHDL- gate level modelling
VHDL- gate level modelling
VandanaPagar1
 
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

Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 

Recently uploaded (20)

Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 

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