+ All Categories
Home > Education > Assic 4th Lecture

Assic 4th Lecture

Date post: 26-Jun-2015
Category:
Upload: babak
View: 84 times
Download: 0 times
Share this document with a friend
Description:
Verilog lect 4
Popular Tags:
19
Verilog HDL Verilog HDL ASIC DESIGN USING FPGA BEIT VII KICSIT Sep 4 2012 Lecture 4
Transcript
Page 1: Assic 4th Lecture

1

Verilog HDLVerilog HDLVerilog HDLVerilog HDL

ASIC DESIGN USING FPGA

BEIT VII

KICSIT

Sep 4 2012 Lecture 4

Page 2: Assic 4th Lecture

2

Introduction Introduction

Sep 4 2012

• Hardware Description Language (HDL)• Verilog was introduced in 1984 by Gateway Design System Corporation, now a part of Cadence Design Systems• Verilog-based synthesis tool introduced by Synopsys in 1987• Standard: IEEE 1364 in 1995

Lecture 4

Page 3: Assic 4th Lecture

3

Event Driven Simulation Event Driven Simulation

Sep 4 2012

• Verilog is really a language for modeling the event driven systems• Event : change in state• Simulation starts at t = 0• Processing events generates new events• When all events at time t have been processed simulation time advances to t+1• Simulation stops when there are no more events in the queue

Lecture 4

Page 4: Assic 4th Lecture

4

Basic Limitation of Verilog Basic Limitation of Verilog

Sep 4 2012

Lecture 4

Description of digital systems only

Page 5: Assic 4th Lecture

5

Abstraction Levels in Verilog Abstraction Levels in Verilog

Sep 4 2012 Lecture 4

Data Flow

Behavioral

Gate

Switch

Page 6: Assic 4th Lecture

6

Main Language Concepts Main Language Concepts

Sep 4 2012

•Concurrency

•Structure

Lecture 4

Page 7: Assic 4th Lecture

7

Main Language Concepts Main Language Concepts

Sep 4 2012 Lecture 4

• Procedural Statements

• Time

Page 8: Assic 4th Lecture

8

User Identifiers User Identifiers

Sep 4 2012 Lecture 4

• Formed from {[A-Z], [a-z], [0-9], _, $},

but can’t begin with $ or [0-9]• myidentifier

• m_y_identifier• 3my_identifier (X)• $my_identifier (X)• _myidentifier$

•Case sensitivity• myid ≠ Myid

Page 9: Assic 4th Lecture

9

Comments Comments

Sep 4 2012 Lecture 4

• // The rest of the line is a comment

•/* Multiple

lines

comment */

• /* Nesting /* comments */ do NOT work

*/

Page 10: Assic 4th Lecture

10

Verilog Value SetVerilog Value Set

Sep 4 2012

• 0 represents low logic level or false condition

• 1 represents high logic level or true condition

• x represents unknown logic level

• z represents high impedance logic level

Lecture 4

Page 11: Assic 4th Lecture

11

Numbers in Verilog Numbers in Verilog

Sep 4 2012

<size>’<radix> <value>

Lecture 4

• 8’h ax = 1010xxxx

•12’o 3zx7 = 011zzzxxx111

Page 12: Assic 4th Lecture

12

Numbers in Verilog Numbers in Verilog

Sep 4 2012

• You can insert “_” for readability• 12’b 000_111_010_100

• 12’b 000111010100• 12’o 07_24

• Bit extension• MS bit = 0, x or z extend this⇒

• 4’b x1 = 4’b xx_x1• MS bit = 1 zero extension⇒

• 4’b 1x = 4’b 00_1xLecture 4

Represent the same number

Page 13: Assic 4th Lecture

13

Nets Nets

Sep 4 2012

• Can be thought as hardware wires driven by logic• Equal to z when unconnected• Various types of nets

• wire• wand (wired-AND)• wor (wired-OR)• tri (tri-state)

Lecture 4

Page 14: Assic 4th Lecture

14

Nets Nets

Sep 4 2012

•In following examples: Y is evaluated, automatically, every time A or B changes

Lecture 4

Page 15: Assic 4th Lecture

15

Nets Nets

Sep 4 2012 Lecture 4

Page 16: Assic 4th Lecture

16

Registers Registers

Sep 4 2012

•Variables that store values

• Do not represent real hardware but ..

• .. real hardware can be implemented with registers

Lecture 4

Page 17: Assic 4th Lecture

17

Registers Registers

Sep 4 2012

• Only one type: reg

• reg A, C; // declaration

// assignments are always done inside a procedure

A = 1;

C = A; // C gets the logical value 1

A = 0; // C is still 1

C = 0; // C is now 0

• Register values are updated explicitly!!Lecture 4

Page 18: Assic 4th Lecture

18

Vectors Vectors

Sep 4 2012

• Represent buses

wire [3:0] busA;

reg [1:4] busB;

reg [1:0] busC;• Left number is MS bit

• Slice management

Lecture 4

busC[1] = busA[2];

busC[0] = busA[1];⇔busC = busA[2:1];

Page 19: Assic 4th Lecture

19

Vectors Vectors

Sep 4 2012

• Vector assignment (by position)

Lecture 4


Recommended