SlideShare a Scribd company logo
1 of 21
 
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  

EVEN	
  
SEMESTER	
  

HDL	
  DESIGN-­‐4-­‐CLASS	
  NOTES	
  –	
  UNIT2	
  
	
  

Shivananda	
  (Shivoo)	
  Koteshwar	
  
	
  

	
  
Professor,	
  E&C	
  Department,	
  PESIT	
  SC	
  	
  
	
  
	
  
	
  
Data-­‐Flow	
  Descriptions	
  
	
  
• Structure	
  
	
  
• Delay	
  Time	
  
	
  
• Data	
  Type	
  –	
  Vectors	
  
	
  
• Common	
  Programming	
  Errors	
  
	
  
	
  
	
  
Reference	
  Books:	
  
	
  
• HDL	
  Programming	
  (VHDL	
  and	
  Verilog)-­‐	
  Nazeih	
  M.Botros-­‐	
  John	
  Weily	
  India	
  Pvt.	
  Ltd.	
  
2008.	
  
	
  
UNIT	
  2:	
  	
  
Data-­‐Flow	
  Descriptions:	
  Highlights	
  of	
  Data-­‐Flow	
  Descriptions,	
  Structure	
  of	
  Data-­‐Flow	
  
Description,	
  Data	
  Type	
  –	
  Vectors.	
   	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  	
  	
  	
  6	
  Hours	
  
	
  
	
  

P e o p l e s 	
   E d u c a t i o n 	
   S o c i e t y 	
   S o u t h 	
   C a m p u s 	
   ( w w w . p e s . e d u ) 	
  

14	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Data Flow - Structure
The keyword is “assign” in Verilog (and <= in VHDL). Steps to be
followed:
1. Understand the logic / Truth Table
2. Represent output as equations (Functions of inputs)
3. Use assign statement and represent the equation

Will this get synthesized or not?

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  2	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

• This will get synthesized because the wire s1,s2; will be implicitly
declared
Will this get synthesized or not?

• This will get synthesized because all these statements occur
simultaneously (concurrently) so the order does not matter
Will this get synthesized or not?

• This will not get synthesized because the simulator will not know
what is s1 and s2. Explicit declaration is required
Will these two give you the same netlist?

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  3	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

• Yes it will give the same netlist.
• The reason why we do the first one is to have a way to represent
internal delays
HALF ADDER:

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  4	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Different Representation of the same Half Adder

NOTE: This will give same netlist as + in Verilog is deduced
internally as xor equation

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  5	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Netlist of each of these representations:

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  6	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  7	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

FULL ADDER:

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  8	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Alternate Implementation of Full Adder:

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  9	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Full Adder with 2 Half Adders (Using Structural Style):

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  10	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  11	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

4 bit Full Adder (Using Structural Style)

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  12	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

n-bit Full Adder (Using Behavioral Style)

2x1 MULTIPLEXER WITH ACTIVE LOW ENABLE

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  13	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  14	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

ALTERNATE IMPLEMENTATION

2x2 UNSIGNED COMBINATIOANL ARRAY MULTIPLIER

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  15	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  16	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

D-LATCH

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  17	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Delay Time
• 2 types of assigning delays
1. Intra-Assignment Delay : variable = #t expression; Usually
used to model a gate delay
2. Delayed Assignment : #t variable = expression; Usually used
to model a delay. E.g. When an output of a multiplier is being
connected to one of the inputs of a logic gate

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  18	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

D-LATCH WITH DELAY

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  19	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Data Type - Vectors
• Vectors are multiple bits
• A register or a net can be declared as a vector
• Vectors are declared by brackets
wire[3:0] a =4’b1010; //declares a net a which has 4
bits and its initial value is 1010
reg[7:0] total = 8’d12; //declares a register total
whose size is 8 bits and its value is decimal 12

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  20	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  
HDL	
  Design	
  (4th	
  Semester	
  VTU)	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  UNIT2	
  Notes	
  v1.0	
  

Common Programming Errors:

	
  
Shivoo	
  Koteshwar’s	
  Notes	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  21	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  shivoo@pes.edu	
  
	
  	
  	
  	
  	
  	
  

More Related Content

What's hot (13)

HDL (hardware description language) presentation
HDL (hardware description language) presentationHDL (hardware description language) presentation
HDL (hardware description language) presentation
 
Vhdl design flow
Vhdl design flowVhdl design flow
Vhdl design flow
 
Vhdl
VhdlVhdl
Vhdl
 
Verilog Lecture1
Verilog Lecture1Verilog Lecture1
Verilog Lecture1
 
VHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDLVHDL-Behavioral-Programs-Structure of VHDL
VHDL-Behavioral-Programs-Structure of VHDL
 
Verilog
VerilogVerilog
Verilog
 
Wi Fi documantation
Wi Fi documantationWi Fi documantation
Wi Fi documantation
 
Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners Short.course.introduction.to.vhdl for beginners
Short.course.introduction.to.vhdl for beginners
 
08 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_1108 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_11
 
Introduction to VHDL - Part 1
Introduction to VHDL - Part 1Introduction to VHDL - Part 1
Introduction to VHDL - Part 1
 
Verilog
VerilogVerilog
Verilog
 
Chapter 5 introduction to VHDL
Chapter 5 introduction to VHDLChapter 5 introduction to VHDL
Chapter 5 introduction to VHDL
 
Lecture1
Lecture1Lecture1
Lecture1
 

Viewers also liked

Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
John Williams
 
Fundamentals of cmos vlsi
Fundamentals of cmos vlsiFundamentals of cmos vlsi
Fundamentals of cmos vlsi
Bhavya Mc
 
105926921 cmos-digital-integrated-circuits-solution-manual-1
105926921 cmos-digital-integrated-circuits-solution-manual-1105926921 cmos-digital-integrated-circuits-solution-manual-1
105926921 cmos-digital-integrated-circuits-solution-manual-1
Savvas Dimopoulos
 
Computer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTUComputer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTU
Siddharaj Junnarkar
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
Abhiraj Bohra
 
Verilog hdl-synthesis-a-practical-primer-j-bhasker
Verilog hdl-synthesis-a-practical-primer-j-bhaskerVerilog hdl-synthesis-a-practical-primer-j-bhasker
Verilog hdl-synthesis-a-practical-primer-j-bhasker
gsivakumar50
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
Muhammad Abdullah
 

Viewers also liked (20)

Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
VHDL Reference
VHDL ReferenceVHDL Reference
VHDL Reference
 
Fundamentals of cmos vlsi
Fundamentals of cmos vlsiFundamentals of cmos vlsi
Fundamentals of cmos vlsi
 
Organization Behavior - Leadership
Organization Behavior - LeadershipOrganization Behavior - Leadership
Organization Behavior - Leadership
 
Digital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil KawareDigital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil Kaware
 
Transistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil KawareTransistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil Kaware
 
105926921 cmos-digital-integrated-circuits-solution-manual-1
105926921 cmos-digital-integrated-circuits-solution-manual-1105926921 cmos-digital-integrated-circuits-solution-manual-1
105926921 cmos-digital-integrated-circuits-solution-manual-1
 
LED basics by Er. Swapnil V. Kaware
LED basics by Er. Swapnil V. KawareLED basics by Er. Swapnil V. Kaware
LED basics by Er. Swapnil V. Kaware
 
3Sem-Logic Design Notes-Unit4-Design and Analysis of Combinational Logic
 3Sem-Logic Design Notes-Unit4-Design and Analysis of Combinational Logic 3Sem-Logic Design Notes-Unit4-Design and Analysis of Combinational Logic
3Sem-Logic Design Notes-Unit4-Design and Analysis of Combinational Logic
 
Vhdl basic unit-2
Vhdl basic unit-2Vhdl basic unit-2
Vhdl basic unit-2
 
concepts and basics of research methodolgy
concepts and basics of research methodolgyconcepts and basics of research methodolgy
concepts and basics of research methodolgy
 
Computer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTUComputer Networks-1 1st unit (10CS55) VTU
Computer Networks-1 1st unit (10CS55) VTU
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
VHDL
VHDLVHDL
VHDL
 
Verilog hdl-synthesis-a-practical-primer-j-bhasker
Verilog hdl-synthesis-a-practical-primer-j-bhaskerVerilog hdl-synthesis-a-practical-primer-j-bhasker
Verilog hdl-synthesis-a-practical-primer-j-bhasker
 
Lecture2 vhdl refresher
Lecture2 vhdl refresherLecture2 vhdl refresher
Lecture2 vhdl refresher
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
Basics of Vhdl
Basics of VhdlBasics of Vhdl
Basics of Vhdl
 
Semiconductor industry for IoT Entrepreneurs
Semiconductor industry for IoT EntrepreneursSemiconductor industry for IoT Entrepreneurs
Semiconductor industry for IoT Entrepreneurs
 

More from Dr. Shivananda Koteshwar

More from Dr. Shivananda Koteshwar (20)

Aurinko Open Day (11th and 12th)
Aurinko Open Day (11th and 12th)Aurinko Open Day (11th and 12th)
Aurinko Open Day (11th and 12th)
 
Aurinko Open Day (Pre KG to 10th Grade)
Aurinko Open Day (Pre KG to 10th Grade)Aurinko Open Day (Pre KG to 10th Grade)
Aurinko Open Day (Pre KG to 10th Grade)
 
BELAKUBE METHODOLOGY
BELAKUBE METHODOLOGYBELAKUBE METHODOLOGY
BELAKUBE METHODOLOGY
 
Belakoo Annual Report 2021-22
Belakoo Annual Report 2021-22Belakoo Annual Report 2021-22
Belakoo Annual Report 2021-22
 
Role of a manager in cultural transformation
Role of a manager in cultural transformationRole of a manager in cultural transformation
Role of a manager in cultural transformation
 
Social Entrepreneurship
Social EntrepreneurshipSocial Entrepreneurship
Social Entrepreneurship
 
Innovation in GCC - Global Capability Center
Innovation in GCC - Global Capability CenterInnovation in GCC - Global Capability Center
Innovation in GCC - Global Capability Center
 
Corporate Expectation from a MBA Graduate
Corporate Expectation from a MBA GraduateCorporate Expectation from a MBA Graduate
Corporate Expectation from a MBA Graduate
 
Introduction to consultancy for MBA Freshers
Introduction to consultancy for MBA FreshersIntroduction to consultancy for MBA Freshers
Introduction to consultancy for MBA Freshers
 
Bachelor of Design (BDes)
Bachelor of Design (BDes)Bachelor of Design (BDes)
Bachelor of Design (BDes)
 
Understanding scale Clean tech and Agritech verticals
Understanding scale   Clean tech and Agritech verticalsUnderstanding scale   Clean tech and Agritech verticals
Understanding scale Clean tech and Agritech verticals
 
Evolution and Advancement in Chipsets
Evolution and Advancement in ChipsetsEvolution and Advancement in Chipsets
Evolution and Advancement in Chipsets
 
Ideation and validation - An exercise
Ideation and validation -  An exerciseIdeation and validation -  An exercise
Ideation and validation - An exercise
 
IoT product business plan creation for entrepreneurs and intrepreneurs
IoT product business plan creation for entrepreneurs and intrepreneursIoT product business plan creation for entrepreneurs and intrepreneurs
IoT product business plan creation for entrepreneurs and intrepreneurs
 
ASIC SoC Verification Challenges and Methodologies
ASIC SoC Verification Challenges and MethodologiesASIC SoC Verification Challenges and Methodologies
ASIC SoC Verification Challenges and Methodologies
 
IoT Product Design and Prototyping
IoT Product Design and PrototypingIoT Product Design and Prototyping
IoT Product Design and Prototyping
 
Business model
Business modelBusiness model
Business model
 
Engaging Today's kids
Engaging Today's kidsEngaging Today's kids
Engaging Today's kids
 
Nurturing Innovative Minds
Nurturing Innovative MindsNurturing Innovative Minds
Nurturing Innovative Minds
 
Creating those dots
Creating those dotsCreating those dots
Creating those dots
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

4Sem VTU-HDL Programming Notes-Unit2-Data Flow Descriptions

  • 1.                                               EVEN   SEMESTER   HDL  DESIGN-­‐4-­‐CLASS  NOTES  –  UNIT2     Shivananda  (Shivoo)  Koteshwar       Professor,  E&C  Department,  PESIT  SC           Data-­‐Flow  Descriptions     • Structure     • Delay  Time     • Data  Type  –  Vectors     • Common  Programming  Errors         Reference  Books:     • HDL  Programming  (VHDL  and  Verilog)-­‐  Nazeih  M.Botros-­‐  John  Weily  India  Pvt.  Ltd.   2008.     UNIT  2:     Data-­‐Flow  Descriptions:  Highlights  of  Data-­‐Flow  Descriptions,  Structure  of  Data-­‐Flow   Description,  Data  Type  –  Vectors.                        6  Hours       P e o p l e s   E d u c a t i o n   S o c i e t y   S o u t h   C a m p u s   ( w w w . p e s . e d u )   14  
  • 2. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Data Flow - Structure The keyword is “assign” in Verilog (and <= in VHDL). Steps to be followed: 1. Understand the logic / Truth Table 2. Represent output as equations (Functions of inputs) 3. Use assign statement and represent the equation Will this get synthesized or not?   Shivoo  Koteshwar’s  Notes                                          2                                                                                          shivoo@pes.edu        
  • 3. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   • This will get synthesized because the wire s1,s2; will be implicitly declared Will this get synthesized or not? • This will get synthesized because all these statements occur simultaneously (concurrently) so the order does not matter Will this get synthesized or not? • This will not get synthesized because the simulator will not know what is s1 and s2. Explicit declaration is required Will these two give you the same netlist?   Shivoo  Koteshwar’s  Notes                                          3                                                                                          shivoo@pes.edu        
  • 4. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   • Yes it will give the same netlist. • The reason why we do the first one is to have a way to represent internal delays HALF ADDER:   Shivoo  Koteshwar’s  Notes                                          4                                                                                          shivoo@pes.edu        
  • 5. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Different Representation of the same Half Adder NOTE: This will give same netlist as + in Verilog is deduced internally as xor equation   Shivoo  Koteshwar’s  Notes                                          5                                                                                          shivoo@pes.edu        
  • 6. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Netlist of each of these representations:   Shivoo  Koteshwar’s  Notes                                          6                                                                                          shivoo@pes.edu        
  • 7. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0     Shivoo  Koteshwar’s  Notes                                          7                                                                                          shivoo@pes.edu        
  • 8. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   FULL ADDER:   Shivoo  Koteshwar’s  Notes                                          8                                                                                          shivoo@pes.edu        
  • 9. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Alternate Implementation of Full Adder:   Shivoo  Koteshwar’s  Notes                                          9                                                                                          shivoo@pes.edu        
  • 10. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Full Adder with 2 Half Adders (Using Structural Style):   Shivoo  Koteshwar’s  Notes                                          10                                                                                    shivoo@pes.edu              
  • 11. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0     Shivoo  Koteshwar’s  Notes                                          11                                                                                    shivoo@pes.edu              
  • 12. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   4 bit Full Adder (Using Structural Style)   Shivoo  Koteshwar’s  Notes                                          12                                                                                    shivoo@pes.edu              
  • 13. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   n-bit Full Adder (Using Behavioral Style) 2x1 MULTIPLEXER WITH ACTIVE LOW ENABLE   Shivoo  Koteshwar’s  Notes                                          13                                                                                    shivoo@pes.edu              
  • 14. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0     Shivoo  Koteshwar’s  Notes                                          14                                                                                    shivoo@pes.edu              
  • 15. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   ALTERNATE IMPLEMENTATION 2x2 UNSIGNED COMBINATIOANL ARRAY MULTIPLIER   Shivoo  Koteshwar’s  Notes                                          15                                                                                    shivoo@pes.edu              
  • 16. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0     Shivoo  Koteshwar’s  Notes                                          16                                                                                    shivoo@pes.edu              
  • 17. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   D-LATCH   Shivoo  Koteshwar’s  Notes                                          17                                                                                    shivoo@pes.edu              
  • 18. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Delay Time • 2 types of assigning delays 1. Intra-Assignment Delay : variable = #t expression; Usually used to model a gate delay 2. Delayed Assignment : #t variable = expression; Usually used to model a delay. E.g. When an output of a multiplier is being connected to one of the inputs of a logic gate   Shivoo  Koteshwar’s  Notes                                          18                                                                                    shivoo@pes.edu              
  • 19. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   D-LATCH WITH DELAY   Shivoo  Koteshwar’s  Notes                                          19                                                                                    shivoo@pes.edu              
  • 20. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Data Type - Vectors • Vectors are multiple bits • A register or a net can be declared as a vector • Vectors are declared by brackets wire[3:0] a =4’b1010; //declares a net a which has 4 bits and its initial value is 1010 reg[7:0] total = 8’d12; //declares a register total whose size is 8 bits and its value is decimal 12   Shivoo  Koteshwar’s  Notes                                          20                                                                                    shivoo@pes.edu              
  • 21. HDL  Design  (4th  Semester  VTU)                                                                                                                UNIT2  Notes  v1.0   Common Programming Errors:   Shivoo  Koteshwar’s  Notes                                          21                                                                                    shivoo@pes.edu