HDL for Combinational Circuits. ENEL211 Digital Technology

Similar documents
EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

Tutorial on Verilog HDL

Chap 6 Introduction to HDL (d)

Hardware Description Languages (HDLs) Verilog

Combinational Logic II

Digital Design with FPGAs. By Neeraj Kulkarni

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

Design Using Verilog

ECEN 449 Microprocessor System Design. Verilog. Texas A&M University

Combinational Logic Circuits

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

Verilog for Combinational Circuits

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Lecture 2: Data Types, Modeling Combinational Logic in Verilog HDL. Variables and Logic Value Set. Data Types. Why use an HDL?

EEL 4783: HDL in Digital System Design

Combinational Logic Design with Verilog. ECE 152A Winter 2012

Verilog Tutorial (Structure, Test)

Verilog Design Principles

Contents. Appendix D Verilog Summary Page 1 of 16

Introduction to Verilog

Lecture 15: System Modeling and Verilog

Hardware Description Language VHDL (1) Introduction

Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog

ECEN 468 Advanced Logic Design

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

ECEN 449 Microprocessor System Design. Verilog. Texas A&M University

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

C-Based Hardware Design

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified.

Introduction to Verilog

A Verilog Primer. An Overview of Verilog for Digital Design and Simulation

Hardware Description Language - Introduction

Introduction to Digital Design with Verilog HDL

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

Chapter 3 Part 2 Combinational Logic Design

N-input EX-NOR gate. N-output inverter. N-input NOR gate

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

COMBINATIONAL LOGIC CIRCUITS

Verilog Design Principles

Concurrent Signal Assignment Statements (CSAs)

Combinational Circuits

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

CENG 241 Digital Design 1

Course Topics - Outline

Chapter 6: Hierarchical Structural Modeling

VHDL Structural Modeling II

EGC220 - Digital Logic Fundamentals

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

EECS150 - Digital Design Lecture 8 - Hardware Description Languages

Chapter 2 Using Hardware Description Language Verilog. Overview

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

DIGITAL SYSTEM DESIGN

P-1/26. Samir Palnitkar. Prentice-Hall, Inc. INSTRUCTOR : CHING-LUNG SU.

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

Hardware Description Language (HDL)

Synthesis of Combinational and Sequential Circuits with Verilog

Introduction to Verilog. Garrison W. Greenwood, Ph.D, P.E.

Hardware description languages


Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Course Topics - Outline

Verilog HDL Introduction

Microcomputers. Outline. Number Systems and Digital Logic Review

Chapter 3: Dataflow Modeling

VHDL Examples Mohamed Zaky

Hardware Description Languages: Verilog

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog

How a Digital Binary Adder Operates

EECS 427 Lecture 14: Verilog HDL Reading: Many handouts/references. EECS 427 W07 Lecture 14 1

Verilog Dataflow Modeling

Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28

Chapter 2a: Structural Modeling

Outline. EECS150 - Digital Design Lecture 5 - Verilog 2. Structural Model: 2-to1 mux. Structural Model - XOR. Verilog Basics Lots of Examples

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Lecture 32: SystemVerilog

Digital Systems Design

MODELING LANGUAGES AND ABSTRACT MODELS. Giovanni De Micheli Stanford University. Chapter 3 in book, please read it.

Systems Programming. Lecture 2 Review of Computer Architecture I

ANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EEM Digital Systems II

Topics of this Slideset. CS429: Computer Organization and Architecture. Digital Signals. Truth Tables. Logic Design

CHAPTER 4: Register Transfer Language and Microoperations

FPGA Design Challenge Techkriti Digital Logic Design using Verilog Part 2 By Neeraj Kulkarni

Digital Logic Design using Verilog and FPGA devices Part 2. An Introductory Lecture Series By Chirag Sangani

*Instruction Matters: Purdue Academic Course Transformation. Introduction to Digital System Design. Module 4 Arithmetic and Computer Logic Circuits

REGISTER TRANSFER AND MICROOPERATIONS

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers

REGISTER TRANSFER AND MICROOPERATIONS

Experiment 7 Arithmetic Circuits Design and Implementation

Lecture 3 Introduction to VHDL

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Last Lecture: Adder Examples

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

Transcription:

HDL for Combinational Circuits ENEL211 Digital Technology

Lecture Outline Vectors Modular design Tri-state gates Dataflow modelling Behavioural Modelling

Vectors Often we want multi-bit quantities in digital circuits bytes, samples, codes, etc. Instead of specifying one wire for each bit we can specify the complete quantity as a vector e.g. output [0:3]D; wire [7:0]SUM;

Vectors The MSB of the vector is first, LSB last. Can address individual bits of a vector e.g. D[2] Can address parts of a vector e.g. SUM[5:3];

2 to 4 line Decoder

2 to 4 line Decoder Example module decoder_gl (A,B,E,D); input A,B,E; output [0:3]D; wire Anot,Bnot; not n1 (Anot,A), n2 (Bnot,B), and n4 (D[0],Anot,Bnot,E), n5 (D[1],Anot,B,E), n6 (D[2],A,Bnot,E), n7 (D[3],A,B,E); endmodule

Modular Design Once a module has been designed it can be used by other modules. This way a design hierarchy can be built up. Module definitions cannot be placed inside another module, they must be defined externally and then incorporated through instantiation.

4 bit Adder

Half Adder module halfadder (S,C,x,y); input x,y; output S,C; //Instantiate primitive gates xor (S,x,y); and (C,x,y); endmodule

Full Adder module fulladder (S,C,x,y,z); input x,y,z; output S,C; wire S1,D1,D2; //Outputs of first XOR and two AND gates //Instantiate the halfadder halfadder HA1 (S1,D1,x,y), HA2 (S,D2,S1,z); or g1(c,d2,d1); endmodule

4 bit Adder module _4bit_adder (S,C4,A,B,C0); input [3:0] A,B; input C0; output [3:0] S; output C4; wire C1,C2,C3; //Intermediate carries //Instantiate the fulladder fulladder FA0 (S[0],C1,A[0],B[0],C0), FA1 (S[1],C2,A[1],B[1],C1), FA2 (S[2],C3,A[2],B[2],C2), FA3 (S[3],C4,A[3],B[3],C3); endmodule

Tri-state gates Binary gates have two states: 0 or 1. Sometimes it is useful to have a third state: undefined In practice undefined is a high-impedance (or open circuit) state where the output has no effect on connected circuits. This is useful for allowing multiple outputs to be connected together (e.g. to a bus)

Tri-state Buffers

Multiplexor Multiplexor is a combinational circuit where an input is chosen by a select signal. Two input mux output =A if select =1 output= B if select =0 A B x s

Two Input Multiplexor A two-input mux is actually a three input device. s A B x 0 0 0 0 A B x 0 0 1 1 0 1 0 0 0 1 1 1 s x = A.s + B.s 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1

Tri-state 2-Input Mux

Tri-state 4-Input Mux

Tri-state Gates in HDL High-impedance state is z Non-inverting gate is bufif1(output, input, control) bufif1(y, A, C) if C=1, Y=A else Y=z

Tri-state Gates bufif1(y,a,c) notif1(y,a,c) bufif0(y,a,c) notif0(y,a,c)

2-Input Tri-state Mux module muxtri (A,B,select,OUT); input A,B,select; output OUT; //use tri data type for output tri OUT; bufif1 (OUT,A,select); bufif0 (OUT,B,select); endmodule

Dataflow modelling Another level of abstraction is to model dataflow. In dataflow models, signals are continuously assigned values using the assign keyword. assign can be used with Boolean expressions. Verilog uses & (and), (or), ^ (xor) and ~ (not) Logic expressions and binary arithmetic are also possible.

Dataflow description of 2 to 4 line Decoder module decoder_df (A,B,E,D); input A,B,E; output [0:3] D; assign D[0] = ~A & ~B & E, D[1] = ~A & B & E, D[2] = A & ~B & E, D[3] = A & B & E; endmodule

Dataflow description of 4 bit Adder module binary_adder (A,B,Cin,SUM,Cout); input [3:0] A,B; input Cin; output [3:0] SUM; output Cout; assign {Cout,SUM} = A + B + Cin; endmodule

Dataflow description of 2-input Mux Conditional operator?:takes three operands: condition? true_expression : false_expression module mux2x1_df (A,B,select,OUT); input A,B,select; output OUT; assign OUT = select? A : B; endmodule

Behavioural Modelling Represents circuits at functional and algorithmic level. Use proceedural statements similar in concept to proceedural programming languages (e.g. C, Java), Behavioural modelling is mostly used to represent sequential circuits.

Behavioural Modelling Behavioural models place proceedural statements in a block after the always keyword. The always keyword takes a list of variables. The block of statements is executed whenever one of the variables changes. The target variables are of type reg. This type retains its value until a new value is assigned.

Behavioral description of 2-input mux module mux2x1_bh(a,b,select,out); input A,B,select; output OUT; reg OUT; always @ (select or A or B) if (select == 1) OUT = A; else OUT = B; endmodule

Behavioral description of 4-input mux module mux4x1_bh (i0,i1,i2,i3,select,y); input i0,i1,i2,i3; input [1:0] select; output y; reg y; always @ (i0 or i1 or i2 or i3 or select) case (select) 2'b00: y = i0; 2'b01: y = i1; 2'b10: y = i2; 2'b11: y = i3; endcase endmodule

HDL Summary Hardware Description Languages allow fast design and verification of digital circuits. Accurate simulation and testing requires delays and inputs to be specified. There are three different levels of abstraction for modelling circuits. Primative (gate level) Dataflow Behavioral