Behavioral Modeling in Verilog

Size: px
Start display at page:

Download "Behavioral Modeling in Verilog"

Transcription

1 Behavioral Modelig i Verilog COE 202 Digital Logic Desig Dr. Muhamed Mudawar Kig Fahd Uiversity of Petroleum ad Mierals

2 Presetatio Outlie Itroductio to Dataflow ad Behavioral Modelig Verilog Operators Module Parameters Modelig Adders, Comparators, Multiplexers Always Block with Sesitivity List Procedural Statemets: IF ad CASE Modelig Decoder, Priority Ecoder, ad ALU Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 2

3 Verilog Four-Valued Logic Verilog Value Set cosists of four basic values: 0 represets a logic zero, or false coditio 1 represets a logic oe, or true coditio X represets a ukow logic value Z represets a high-impedace value x or X represets a ukow or uiitialized value z or Z represets the output of a disabled tri-state buffer Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 3

4 Nets ad Variables Verilog has two major data types: 1. Net data types: are coectios betwee parts of a desig 2. Variable data types: ca store data values The wire is a et data type (physical coectio) A wire caot store the value of a procedural assigmet However, a wire ca be drive by cotiuous assigmet The reg is a variable data type Ca store the value of a procedural assigmet However, caot be drive by cotiuous assigmet Other variable types: iteger, time, real, ad realtime Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 4

5 Modelig Circuits i Verilog Four levels of modelig circuits i Verilog 1. Gate-Level Modelig Lowest-level modelig usig Verilog primitive gates 2. Structural Modelig usig module istatiatio Describes the structure of a circuit with modules at differet levels 3. Dataflow Modelig usig cocurret assig statemets Describes the flow of data betwee iput ad output 4. Behavioral Modelig usig procedural blocks ad statemets Describes what the circuit does at a higher level of abstractio Ca also mix differet models i the same desig Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 5

6 Dataflow ad Behavioral Modelig Dataflow Modelig usig Cotiuous Assigmet Used mostly for describig Boolea equatios ad combiatioal logic Verilog provides a rich set of operators Ca describe: adders, comparators, multiplexers, etc. Sythesis tool ca map a dataflow model ito a target techology Behavioral Modelig usig Procedural Blocks ad Statemets Describes what the circuit does at a fuctioal ad algorithmic level Ecourages desigers to rapidly create a prototype Ca be verified easily with a simulator Some procedural statemets are sythesizable (Others are NOT) Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 6

7 Cotiuous Assigmet The assig statemet defies cotiuous assigmet Sytax: assig [#delay] et_ame = expressio; Assigs expressio value to et_ame (wire or output port) The optioal #delay specifies the delay of the assigmet Cotiuous assigmet statemets are cocurret Ca appear i ay order iside a module Cotiuous assigmet ca model combiatioal circuits Describes the flow of data betwee iput ad output Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 7

8 Verilog Operators Bitwise Operators ~a Bitwise NOT a & b Bitwise AND a b Bitwise OR a ^ b Bitwise XOR a ~^ b Bitwise XNOR a ^~ b Same as ~^ Arithmetic Operators a + b ADD a b Subtract -a Negate a * b Multiply a / b Divide a % b Remaider Relatioal Operators a == b Equality a!= b Iequality a < b Less tha a > b Greater tha a <= b Less or equal a >= b Greater or equal Reductio Operators &a AND all bits a OR all bits ^a XOR all bits ~&a NAND all bits ~ a NOR all bits ~^a XNOR all bits Shift Operators Miscellaeous Operators a << Shift Left sel?a:b Coditioal a >> Shift Right {a, b} Cocateate Reductio operators produce a 1-bit result Relatioal operators produce a 1-bit result {a, b} cocateates the bits of a ad b Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 8

9 Bit Vectors i Verilog A Bit Vector is multi-bit declaratio that uses a sigle ame A Bit Vector is specified as a Rage [msb:lsb] msb is most-sigificat bit ad lsb is least-sigificat bit Examples: iput [15:0] A; output [0:15] B; // A is a 16-bit iput vector // Bit 0 is most-sigificat bit wire [3:0] W; // Bit 3 is most-sigificat bit Bit select: W[1] is bit 1 of W Part select: A[11:8] is a 4-bit select of A with rage [11:8] The part select rage must be cosistet with vector declaratio Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 9

10 Reductio Operators module Reduce ( iput [3:0] A, B, output X, Y, Z ); // A, B are iput vectors, X, Y, Z are 1-bit outputs // X = A[3] A[2] A[1] A[0]; assig X = A; // Y = B[3] & B[2] & B[1] & B[0]; assig Y = &B; // Z = X & (B[3] ^ B[2] ^ B[1] ^ B[0]); assig Z = X & (^B); edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 10

11 Cocateatio Operator { } module Cocateate ( iput [7:0] A, B, output [7:0] X, Y, Z ); // A, B are iput vectors, X, Y, Z are output vectors // X = A is right-shifted 3 bits usig { } operator assig X = {3'b000, A[7:3]}; // Y = A is right-rotated 3 bits usig { } operator assig Y = {A[2:0], A[7:3]}; // Z = selectig ad cocateatig bits of A ad B assig Z = {A[5:4], B[6:3], A[1:0]}; edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 11

12 Iteger Literals (Costat Values) Sytax: [size]['base]value size (optioal) is the umber of bits i the value 'base ca be: 'b(biary), 'o(octal), 'd(decimal), or 'h(hex) value ca be i biary, octal, decimal, or hexadecimal If the 'base is ot specified the decimal value Examples: 8'b1011_1101 (8-bit biary), 'ha3f0 (16-bit hexadecimal) 16'o56377 (16-bit octal), 32'd999 (32-bit decimal) The uderscore _ ca be used to ehace readability of value Whe size is fewer bits tha value, upper bits are trucated Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 12

13 Ripple Carry Adder Usig idetical copies of a full adder to build a large adder The cell (iterative block) is a full adder Adds 3 bits: a i, b i, c i, Computes: Sum s i ad Carry-out c i+1 Carry-out of cell i becomes carry-i to cell (i +1) a -1 b -1 a 1 b 1 a 0 b 0 a i b i c Full Adder c c 2 Full Adder c 1 Full Adder c 0 c i+1 Full Adder c i s -1 s 1 s 0 s i Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 13

14 16-Bit Adder with Array Istatiatio // Iput ports: 16-bit a ad b, 1-bit ci (carry iput) // Output ports: 16-bit sum, 1-bit cout (carry output) module Adder_16 (iput [15:0] a, b, iput ci, output [15:0] sum, output cout); wire [16:0] c; assig c[0] = ci; assig cout = c[16]; // carry bits // carry iput // carry output // Istatiate a array of 16 Full Adders // Each istace [i] is coected to bit select [i] Full_Adder FA [15:0] (a[15:0], b[15:0], c[15:0], c[16:1], sum[15:0]); edmodule Array Istatiatio of idetical modules by a sigle statemet Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 14

15 16-Bit Adder with Cotiuous Assigmet // Iput ports: 16-bit a ad b, 1-bit ci (carry iput) // Output ports: 16-bit sum, 1-bit cout (carry output) module Adder_16 (iput [15:0] a, b, iput ci, output [15:0] sum, output cout); wire [16:0] c; assig c[0] = ci; assig cout = c[16]; // carry bits // carry iput // carry output // assigmet of 16-bit vectors assig sum[15:0] = (a[15:0] ^ b[15:0]) ^ c[15:0]; assig c[16:1] = (a[15:0] & b[15:0]) (a[15:0] ^ b[15:0]) & c[15:0]; edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 15

16 16-bit Adder with the + Operator module Adder16 ( iput [15:0] A, B, iput ci, output [15:0] Sum, output cout ); // A ad B are 16-bit iput vectors // Sum is a 16-bit output vector // {cout, Sum} is a cocateated 17-bit vector // A + B + ci is 16-bit additio + iput carry // The + operator is traslated ito a adder assig {cout, Sum} = A + B + ci; edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 16

17 Modelig a Parametric -bit Adder // Parametric -bit adder, default value for = 16 module Adder #(parameter = 16) ( iput [-1:0] A, B, iput ci, output [-1:0] Sum, output cout ); // A ad B are -bit iput vectors // Sum is a -bit output vector // The + operator is traslated ito a -bit adder // Oly oe assig statemet is used assig {cout, Sum} = A + B + ci; edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 17

18 Istatiatig Adders of Various Sizes // Istatiate a 16-bit adder (parameter = 16) // A1, B1, ad Sum1 must be 16-bit vectors Adder #(16) adder16 (A1, B1, Ci1, Sum1, Cout1); // Istatiate a 32-bit adder (parameter = 32) // A2, B2, ad Sum2 must be 32-bit vectors Adder #(32) adder32 (A2, B2, Ci2, Sum2, Cout2); // If parameter is ot specified, it defaults to 16 Adder adder16 (A1, B1, Ci1, Sum1, Cout1); Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 18

19 Modelig a Magitude Comparator // -bit magitude comparator, No default value for module Comparator #(parameter ) (iput [-1:0] A, B, output GT, EQ, LT); // A ad B are -bit iput vectors (usiged) // GT, EQ, ad LT are 1-bit outputs assig GT = (A > B); assig EQ = (A == B); assig LT = (A < B); edmodule A[ 1:0] B[ 1:0] -bit Magitude Comparator GT EQ LT Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 19

20 Istatiatig Comparators of Various Sizes // Istatiate a 16-bit comparator ( = 16) // A1 ad B1 must be declared as 16-bit vectors Comparator #(16) comp16 (A1, B1, GT1, EQ1, LT1); // Istatiate a 32-bit comparator ( = 32) // A2 ad B2 must be declared as 32-bit vectors Comparator #(32) comp32 (A2, B2, GT2, EQ2, LT2); // WRONG Istatiatio: Must specify parameter Comparator comp32 (A2, B2, GT2, EQ2, LT2); Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 20

21 Coditioal Operator Sytax: Boolea_expr? True_expressio : False_expressio If Boolea_expr is true the select True_expressio Else select False_Expressio Examples: assig max = (a>b)? a : b; // maximum of a ad b assig mi = (a>b)? b : a; // miimum of a ad b Coditioal operators ca be ested Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 21

22 Modelig a 2x1 Multiplexer // Parametric 2x1 Mux, default value for = 1 module Mux2 #(parameter = 1) ( iput [-1:0] A, B, iput sel, A output [-1:0] Z); B // A ad B are -bit iput vectors // Z is the -bit output vector // if (sel==0) Z = A; else Z = B; 0 1 // Coditioal operator used for selectio assig Z = (sel == 0)? A : B; edmodule sel Z Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 22

23 Modelig a 4x1 Multiplexer // Parametric 4x1 Mux, default value for = 1 module Mux4 #(parameter = 1) ( iput [-1:0] A, B, C, D, iput [1:0] sel, A output [-1:0] Z ); B // sel is a 2-bit vector C // Nested coditioal operators D assig Z = (sel[1] == 0)? ((sel[0] == 0)? A : B) : ((sel[0] == 0)? C : D); edmodule sel Z Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 23

24 Behavioral Modelig Uses procedural blocks ad procedural statemets There are two types of procedural blocks i Verilog 1. The iitial block Executes the eclosed statemet(s) oe time oly 2. The always block Executes the eclosed statemet(s) repeatedly util simulatio termiates The body of the iitial ad always blocks is procedural Ca eclose oe or more procedural statemets Procedural statemets are surrouded by begi ed Multiple procedural blocks ca appear i ay order iside a module ad ru i parallel iside the simulator Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 24

25 Example of Iitial ad Always Blocks module behave; reg clk; // 1-bit variable reg [15:0] A; // 16-bit variable iitial begi // executed oce clk = 0; // iitialize clk A = 16'h1234; // iitialize A #200 $fiish ed always begi // executed always #10 clk = ~clk; // ivert clk every 10 s ed always begi // executed always #20 A = A + 1; // icremet A every 20 s ed edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 25

26 Always Block with Sesitivity List Sytax: list) begi procedural statemets ed A always block ca have a sesitivity list Sesitivity list is a list of sigal2, ) The sesitivity list triggers the executio of the always block Whe there is a chage of value i ay listed sigal Otherwise, the always block does othig util aother chage occurs o a sigal i the sesitivity list Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 26

27 Sesitivity List for Combiatioal Logic For combiatioal logic, the sesitivity list must iclude: ALL the sigals that are read iside the always block Example: A, B, ad sel must be i the sesitivity list below: B, sel) begi if (sel == 0) Z = A; else Z = B; ed A, B, ad sel are read iside the always block Combiatioal logic ca also or is automatically sesitive to all the sigals that are read iside the always block Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 27

28 If Statemet The if statemet is procedural Ca oly be used iside a procedural block Sytax: if (expressio) statemet [ else statemet ] The else part is optioal A statemet ca be simple or compoud A compoud statemet is surrouded by begi... ed if statemets ca be ested Ca be ested uder if or uder else part Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 28

29 Modelig a 2x1 Multiplexer // Behavioral Modelig of a Parametric 2x1 Mux module Mux2 #(parameter = 1) ( iput [-1:0] A, B, iput sel, output reg [-1:0] Z); // Output Z must be of type reg // Sesitivity list B, sel) B, sel) begi if (sel == 0) Z = A; else Z = B; ed A B 0 1 Z edmodule sel Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 29

30 Modelig a 3x8 Decoder module Decoder3x8 (iput [2:0] A, output reg [7:0] D); // Sesitivity list begi if (A == 0) D = 8'b ; else if (A == 1) D = 8'b ; else if (A == 2) D = 8'b ; else if (A == 3) D = 8'b ; else if (A == 4) D = 8'b ; else if (A == 5) D = 8'b ; else if (A == 6) D = 8'b ; else D = 8'b ; ed edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 30

31 Modelig a 4x2 Priority Ecoder module Priority_Ecoder4x2 (iput [3:0] D, output reg V, output reg [1:0] A); // sesitivity list begi if (D[3]) {V, A} = 3'b111; else if (D[2]) {V, A} = 3'b110; else if (D[1]) {V, A} = 3'b101; else if (D[0]) {V, A} = 3'b100; else {V, A} = 3'b000; ed edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 31

32 Modelig a Magitude Comparator // Behavioral Modelig of a Magitude Comparator module Comparator #(parameter = 1) (iput [-1:0] A, B, output reg GT, EQ, LT); // Sesitivity list B) B) begi if (A > B) {GT,EQ,LT}='b100; else if (A == B) A[ 1:0] -bit {GT,EQ,LT}='b010; Magitude else {GT,EQ,LT}='b001; ed edmodule B[ 1:0] Comparator GT EQ LT Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 32

33 Case Statemet The case statemet is procedural (used iside always block) Sytax: case (expressio) case_item1: statemet case_item2: statemet... default: statemet edcase The default case is optioal A statemet ca be simple or compoud A compoud statemet is surrouded by begi... ed Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 33

34 Modelig a Mux with a Case Statemet module Mux4 #(parameter = 1) ( iput [-1:0] A, B, C, D, iput [1:0] sel, output reg [-1:0] Z ); B, C, D, sel) begi case (sel) 2'b00: Z = A; 2'b01: Z = B; 2'b10: Z = C; default: Z = D; edcase ed edmodule A B C D sel Z Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 34

35 Modelig a Multifuctio ALU // Behavioral Modelig of a ALU module ALU #(parameter = 16) ( iput [-1:0] A, B, iput [1:0] F, output reg [-1:0] Z, output reg Cout ); B, F) begi case (F) 2'b00: {Cout,Z} = A+B; 2'b01: {Cout,Z} = A-B; 2'b10: {Cout,Z} = A&B; default: {Cout,Z} = A B; edcase ed edmodule F [1:0] A [-1:0] ALU Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 35 2 ALU Symbol Cout Z [-1:0] B [-1:0]

36 Modelig a BCD to 7-Segmet Decoder module BCD_to_7Seg_Decoder ( iput [3:0] BCD, output reg [6:0] Seg ) begi case (BCD) 0: Seg = 7'b ; 1: Seg = 7'b ; 2: Seg = 7'b ; 3: Seg = 7'b ; 4: Seg = 7'b ; 5: Seg = 7'b ; 6: Seg = 7'b ; 7: Seg = 7'b ; 8: Seg = 7'b ; 9: Seg = 7'b ; default: Seg = 7'b ; edcase ed edmodule Behavioral Modelig i Verilog COE 202 Digital Logic Desig Muhamed Mudawar slide 36

EE260: Digital Design, Spring /16/18. n Example: m 0 (=x 1 x 2 ) is adjacent to m 1 (=x 1 x 2 ) and m 2 (=x 1 x 2 ) but NOT m 3 (=x 1 x 2 )

EE260: Digital Design, Spring /16/18. n Example: m 0 (=x 1 x 2 ) is adjacent to m 1 (=x 1 x 2 ) and m 2 (=x 1 x 2 ) but NOT m 3 (=x 1 x 2 ) EE26: Digital Desig, Sprig 28 3/6/8 EE 26: Itroductio to Digital Desig Combiatioal Datapath Yao Zheg Departmet of Electrical Egieerig Uiversity of Hawaiʻi at Māoa Combiatioal Logic Blocks Multiplexer Ecoders/Decoders

More information

Digital System Design

Digital System Design July, 22 9:55 vra235_ch Sheet umber Page umber 65 black chapter Digital System Desig a b c d e f g h 8 7 6 5 4 3 2. Bd3 g6+, Ke8 d8 65 July, 22 9:55 vra235_ch Sheet umber 2 Page umber 66 black 66 CHAPTER

More information

CS 11 C track: lecture 1

CS 11 C track: lecture 1 CS 11 C track: lecture 1 Prelimiaries Need a CMS cluster accout http://acctreq.cms.caltech.edu/cgi-bi/request.cgi Need to kow UNIX IMSS tutorial liked from track home page Track home page: http://courses.cms.caltech.edu/courses/cs11/material

More information

Chapter 2. C++ Basics. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 2. C++ Basics. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 2 C++ Basics Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 2.1 Variables ad Assigmets 2.2 Iput ad Output 2.3 Data Types ad Expressios 2.4 Simple Flow of Cotrol 2.5 Program

More information

Digital Design with FPGAs. By Neeraj Kulkarni

Digital Design with FPGAs. By Neeraj Kulkarni Digital Design with FPGAs By Neeraj Kulkarni Some Basic Electronics Basic Elements: Gates: And, Or, Nor, Nand, Xor.. Memory elements: Flip Flops, Registers.. Techniques to design a circuit using basic

More information

Java Expressions & Flow Control

Java Expressions & Flow Control Java Expressios & Flow Cotrol Rui Moreira Expressio Separators:. [ ] ( ), ; Dot used as decimal separator or to access attributes ad methods double d = 2.6; Poto poto = ew Poto(2, 3); it i = poto.x; it

More information

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 9 Poiters ad Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 9.1 Poiters 9.2 Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Slide 9-3

More information

Module Instantiation. Finite State Machines. Two Types of FSMs. Finite State Machines. Given submodule mux32two: Instantiation of mux32two

Module Instantiation. Finite State Machines. Two Types of FSMs. Finite State Machines. Given submodule mux32two: Instantiation of mux32two Give submodule mux32two: 2-to- MUX module mux32two (iput [3:] i,i, iput sel, output [3:] out); Module Istatiatio Fiite Machies esig methodology for sequetial logic -- idetify distict s -- create trasitio

More information

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 13 Control and Sequencing: Hardwired and Microprogrammed Control

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 13 Control and Sequencing: Hardwired and Microprogrammed Control EE 459/500 HDL Based Digital Desig with Programmable Logic Lecture 13 Cotrol ad Sequecig: Hardwired ad Microprogrammed Cotrol Refereces: Chapter s 4,5 from textbook Chapter 7 of M.M. Mao ad C.R. Kime,

More information

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design College of Computer ad Iformatio Scieces Departmet of Computer Sciece CSC 220: Computer Orgaizatio Uit 11 Basic Computer Orgaizatio ad Desig 1 For the rest of the semester, we ll focus o computer architecture:

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 18 Strategies for Query Processig Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio DBMS techiques to process a query Scaer idetifies

More information

Lecture 2. RTL Design Methodology. Transition from Pseudocode & Interface to a Corresponding Block Diagram

Lecture 2. RTL Design Methodology. Transition from Pseudocode & Interface to a Corresponding Block Diagram Lecture 2 RTL Desig Methodology Trasitio from Pseudocode & Iterface to a Correspodig Block Diagram Structure of a Typical Digital Data Iputs Datapath (Executio Uit) Data Outputs System Cotrol Sigals Status

More information

ECEN 468 Advanced Logic Design

ECEN 468 Advanced Logic Design ECEN 468 Advanced Logic Design Lecture 26: Verilog Operators ECEN 468 Lecture 26 Operators Operator Number of Operands Result Arithmetic 2 Binary word Bitwise 2 Binary word Reduction 1 Bit Logical 2 Boolean

More information

Chapter 4. Procedural Abstraction and Functions That Return a Value. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 4. Procedural Abstraction and Functions That Return a Value. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 4 Procedural Abstractio ad Fuctios That Retur a Value Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 4.1 Top-Dow Desig 4.2 Predefied Fuctios 4.3 Programmer-Defied Fuctios 4.4

More information

Introduction to Verilog

Introduction to Verilog Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Presentation Outline Hardware Description Language Logic Simulation versus Synthesis

More information

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup Note:

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup   Note: Chapter 4 Computatio Bjare Stroustrup www.stroustrup.com/programmig Abstract Today, I ll preset the basics of computatio. I particular, we ll discuss expressios, how to iterate over a series of values

More information

CMPT 125 Assignment 2 Solutions

CMPT 125 Assignment 2 Solutions CMPT 25 Assigmet 2 Solutios Questio (20 marks total) a) Let s cosider a iteger array of size 0. (0 marks, each part is 2 marks) it a[0]; I. How would you assig a poiter, called pa, to store the address

More information

Reversible Realization of Quaternary Decoder, Multiplexer, and Demultiplexer Circuits

Reversible Realization of Quaternary Decoder, Multiplexer, and Demultiplexer Circuits Egieerig Letters, :, EL Reversible Realizatio of Quaterary Decoder, Multiplexer, ad Demultiplexer Circuits Mozammel H.. Kha, Member, ENG bstract quaterary reversible circuit is more compact tha the correspodig

More information

Chapter 4 The Datapath

Chapter 4 The Datapath The Ageda Chapter 4 The Datapath Based o slides McGraw-Hill Additioal material 24/25/26 Lewis/Marti Additioal material 28 Roth Additioal material 2 Taylor Additioal material 2 Farmer Tae the elemets that

More information

Modeling Sequential Circuits in Verilog

Modeling Sequential Circuits in Verilog Modeling Sequential Circuits in Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Presentation Outline Modeling Latches and Flip-Flops Blocking versus

More information

Algorithm Design Techniques. Divide and conquer Problem

Algorithm Design Techniques. Divide and conquer Problem Algorithm Desig Techiques Divide ad coquer Problem Divide ad Coquer Algorithms Divide ad Coquer algorithm desig works o the priciple of dividig the give problem ito smaller sub problems which are similar

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 1 Computers ad Programs 1 Objectives To uderstad the respective roles of hardware ad software i a computig system. To lear what computer scietists

More information

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

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 Anurag Dwivedi Digital Design : Bottom Up Approach Basic Block - Gates Digital Design : Bottom Up Approach Gates -> Flip Flops Digital

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter The Processor Part A path Desig Itroductio CPU performace factors Istructio cout Determied by ISA ad compiler. CPI ad

More information

Bluespec-3: Modules & Interfaces. Bluespec: State and Rules organized into modules

Bluespec-3: Modules & Interfaces. Bluespec: State and Rules organized into modules Bluespec-3: Modules & Iterfaces Arvid Computer Sciece & Artificial Itelligece Lab Massachusetts Istitute of Techology Based o material prepared by Bluespec Ic, Jauary 2005 February 28, 2005 L09-1 Bluespec:

More information

Design Using Verilog

Design Using Verilog EGC220 Design Using Verilog Baback Izadi Division of Engineering Programs bai@engr.newpaltz.edu Basic Verilog Lexical Convention Lexical convention are close to C++. Comment // to the of the line. /* to

More information

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1 COSC 1P03 Ch 7 Recursio Itroductio to Data Structures 8.1 COSC 1P03 Recursio Recursio I Mathematics factorial Fiboacci umbers defie ifiite set with fiite defiitio I Computer Sciece sytax rules fiite defiitio,

More information

Computers and Scientific Thinking

Computers and Scientific Thinking Computers ad Scietific Thikig David Reed, Creighto Uiversity Chapter 15 JavaScript Strigs 1 Strigs as Objects so far, your iteractive Web pages have maipulated strigs i simple ways use text box to iput

More information

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 11 Frieds, Overloaded Operators, ad Arrays i Classes Copyright 2014 Pearso Addiso-Wesley. All rights reserved. Overview 11.1 Fried Fuctios 11.2 Overloadig Operators 11.3 Arrays ad Classes 11.4

More information

8.0 Resolving Multi-Signal Drivers

8.0 Resolving Multi-Signal Drivers Fileame= ch8_2 8.0 Resolvig Multi-Sigal Drivers 8.1 Buses B ACTL BCTL DBUS DBUS A DBUS Ope circle deotes a iput coectio Solid dot deotes a output coectio The ope circles at the bus iputs respreset switched

More information

. Written in factored form it is easy to see that the roots are 2, 2, i,

. Written in factored form it is easy to see that the roots are 2, 2, i, CMPS A Itroductio to Programmig Programmig Assigmet 4 I this assigmet you will write a java program that determies the real roots of a polyomial that lie withi a specified rage. Recall that the roots (or

More information

1. Mark the correct statement(s)

1. Mark the correct statement(s) 1. Mark the correct statement(s) 1.1 A theorem in Boolean algebra: a) Can easily be proved by e.g. logic induction b) Is a logical statement that is assumed to be true, c) Can be contradicted by another

More information

Analysis Metrics. Intro to Algorithm Analysis. Slides. 12. Alg Analysis. 12. Alg Analysis

Analysis Metrics. Intro to Algorithm Analysis. Slides. 12. Alg Analysis. 12. Alg Analysis Itro to Algorithm Aalysis Aalysis Metrics Slides. Table of Cotets. Aalysis Metrics 3. Exact Aalysis Rules 4. Simple Summatio 5. Summatio Formulas 6. Order of Magitude 7. Big-O otatio 8. Big-O Theorems

More information

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 5 Fuctios for All Subtasks Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 5.1 void Fuctios 5.2 Call-By-Referece Parameters 5.3 Usig Procedural Abstractio 5.4 Testig ad Debuggig

More information

Lecture 3. RTL Design Methodology. Transition from Pseudocode & Interface to a Corresponding Block Diagram

Lecture 3. RTL Design Methodology. Transition from Pseudocode & Interface to a Corresponding Block Diagram Lecture 3 RTL Desig Methodology Trasitio from Pseudocode & Iterface to a Correspodig Block Diagram Structure of a Typical Digital Data Iputs Datapath (Executio Uit) Data Outputs System Cotrol Sigals Status

More information

Combinational Logic II

Combinational Logic II Combinational Logic II Ranga Rodrigo July 26, 2009 1 Binary Adder-Subtractor Digital computers perform variety of information processing tasks. Among the functions encountered are the various arithmetic

More information

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 10 Defiig Classes Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 10.1 Structures 10.2 Classes 10.3 Abstract Data Types 10.4 Itroductio to Iheritace Copyright 2015 Pearso Educatio,

More information

Chapter 3. More Flow of Control. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 3. More Flow of Control. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 3 More Flow of Cotrol Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 3.1 Usig Boolea Expressios 3.2 Multiway Braches 3.3 More about C++ Loop Statemets 3.4 Desigig Loops Copyright

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 19 Query Optimizatio Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio Query optimizatio Coducted by a query optimizer i a DBMS Goal:

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 20 Itroductio to Trasactio Processig Cocepts ad Theory Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio Trasactio Describes local

More information

CS 111: Program Design I Lecture # 7: First Loop, Web Crawler, Functions

CS 111: Program Design I Lecture # 7: First Loop, Web Crawler, Functions CS 111: Program Desig I Lecture # 7: First Loop, Web Crawler, Fuctios Robert H. Sloa & Richard Warer Uiversity of Illiois at Chicago September 18, 2018 What will this prit? x = 5 if x == 3: prit("hi!")

More information

Neural Networks A Model of Boolean Functions

Neural Networks A Model of Boolean Functions Neural Networks A Model of Boolea Fuctios Berd Steibach, Roma Kohut Freiberg Uiversity of Miig ad Techology Istitute of Computer Sciece D-09596 Freiberg, Germay e-mails: steib@iformatik.tu-freiberg.de

More information

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

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages 14:332:231 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 2013 Lecture #22: Introduction to Verilog Hardware Description Languages Basic idea: Language constructs

More information

Elementary Educational Computer

Elementary Educational Computer Chapter 5 Elemetary Educatioal Computer. Geeral structure of the Elemetary Educatioal Computer (EEC) The EEC coforms to the 5 uits structure defied by vo Neuma's model (.) All uits are preseted i a simplified

More information

Chapter 2 Using Hardware Description Language Verilog. Overview

Chapter 2 Using Hardware Description Language Verilog. Overview Chapter 2 Using Hardware Description Language Verilog CSE4210 Winter 2012 Mokhtar Aboelaze based on slides by Dr. Shoab A. Khan Overview Algorithm development isa usually done in MATLAB, C, or C++ Code

More information

Solutions to Final COMS W4115 Programming Languages and Translators Monday, May 4, :10-5:25pm, 309 Havemeyer

Solutions to Final COMS W4115 Programming Languages and Translators Monday, May 4, :10-5:25pm, 309 Havemeyer Departmet of Computer ciece Columbia Uiversity olutios to Fial COM W45 Programmig Laguages ad Traslators Moday, May 4, 2009 4:0-5:25pm, 309 Havemeyer Closed book, o aids. Do questios 5. Each questio is

More information

Chap 6 Introduction to HDL (d)

Chap 6 Introduction to HDL (d) Design with Verilog Chap 6 Introduction to HDL (d) Credit to: MD Rizal Othman Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang Ext: 6036 VERILOG HDL Basic Unit A module Module

More information

EE University of Minnesota. Midterm Exam #1. Prof. Matthew O'Keefe TA: Eric Seppanen. Department of Electrical and Computer Engineering

EE University of Minnesota. Midterm Exam #1. Prof. Matthew O'Keefe TA: Eric Seppanen. Department of Electrical and Computer Engineering EE 4363 1 Uiversity of Miesota Midterm Exam #1 Prof. Matthew O'Keefe TA: Eric Seppae Departmet of Electrical ad Computer Egieerig Uiversity of Miesota Twi Cities Campus EE 4363 Itroductio to Microprocessors

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programmig Laguages Fuctioal Programmig Prof. Robert va Egele Overview What is fuctioal programmig? Historical origis of fuctioal programmig Fuctioal programmig today Cocepts of fuctioal programmig

More information

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

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two major languages Verilog (IEEE 1364), latest version is

More information

Verilog Dataflow Modeling

Verilog Dataflow Modeling Verilog Dataflow Modeling Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Spring, 2017 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Source:

More information

6.175: Constructive Computer Architecture. Oct 7,

6.175: Constructive Computer Architecture. Oct 7, 6.175: Costructive Computer Architecture Tutorial 2 Advaced BSV Qua Nguye (Now uses the correct dates o PPT slides) T02-1 Admiistrivia Today is add date! Please test vlsifarm machies Remaiig labs schedule

More information

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Pseudocode ( 1.1) High-level descriptio of a algorithm More structured

More information

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

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University Digital Circuit Design and Language Datapath Design Chang, Ik Joon Kyunghee University Typical Synchronous Design + Control Section : Finite State Machine + Data Section: Adder, Multiplier, Shift Register

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 6 Defiig Fuctios Pytho Programmig, 2/e 1 Objectives To uderstad why programmers divide programs up ito sets of cooperatig fuctios. To be able to

More information

implement language system

implement language system Outlie Priciples of programmig laguages Lecture 3 http://few.vu.l/~silvis/ppl/2007 Part I. Laguage systems Part II. Fuctioal programmig. First look at ML. Natalia Silvis-Cividjia e-mail: silvis@few.vu.l

More information

CS : Programming for Non-Majors, Summer 2007 Programming Project #3: Two Little Calculations Due by 12:00pm (noon) Wednesday June

CS : Programming for Non-Majors, Summer 2007 Programming Project #3: Two Little Calculations Due by 12:00pm (noon) Wednesday June CS 1313 010: Programmig for No-Majors, Summer 2007 Programmig Project #3: Two Little Calculatios Due by 12:00pm (oo) Wedesday Jue 27 2007 This third assigmet will give you experiece writig programs that

More information

Introduction CHAPTER Computers

Introduction CHAPTER Computers Iside a Computer CHAPTER Itroductio. Computers A computer is a electroic device that accepts iput, stores data, processes data accordig to a set of istructios (called program), ad produces output i desired

More information

CMSC Computer Architecture Lecture 3: ISA and Introduction to Microarchitecture. Prof. Yanjing Li University of Chicago

CMSC Computer Architecture Lecture 3: ISA and Introduction to Microarchitecture. Prof. Yanjing Li University of Chicago CMSC 22200 Computer Architecture Lecture 3: ISA ad Itroductio to Microarchitecture Prof. Yajig Li Uiversity of Chicago Lecture Outlie ISA uarch (hardware implemetatio of a ISA) Logic desig basics Sigle-cycle

More information

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

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 I hope you have completed Part 1 of the Experiment. This lecture leads you to Part 2 of the experiment and hopefully helps you with your progress to Part 2. It covers a number of topics: 1. How do we specify

More information

Lecture 5. Counting Sort / Radix Sort

Lecture 5. Counting Sort / Radix Sort Lecture 5. Coutig Sort / Radix Sort T. H. Corme, C. E. Leiserso ad R. L. Rivest Itroductio to Algorithms, 3rd Editio, MIT Press, 2009 Sugkyukwa Uiversity Hyuseug Choo choo@skku.edu Copyright 2000-2018

More information

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

A Verilog Primer. An Overview of Verilog for Digital Design and Simulation A Verilog Primer An Overview of Verilog for Digital Design and Simulation John Wright Vighnesh Iyer Department of Electrical Engineering and Computer Sciences College of Engineering, University of California,

More information

L6: FSMs and Synchronization

L6: FSMs and Synchronization L6: FSMs ad Sychroizatio Ackowledgemets: Materials i this lecture are courtesy of the followig sources ad are used with permissio. Rex Mi J. Rabaey, A. Chadrakasa, B. Nikolic. igital Itegrated Circuits:

More information

Chapter 3: Dataflow Modeling

Chapter 3: Dataflow Modeling Chapter 3: Dataflow Modeling Prof. Soo-Ik Chae Digital System Designs and Practices Using Verilog HDL and FPGAs @ 2008, John Wiley 3-1 Objectives After completing this chapter, you will be able to: Describe

More information

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs What are we goig to lear? CSC316-003 Data Structures Aalysis of Algorithms Computer Sciece North Carolia State Uiversity Need to say that some algorithms are better tha others Criteria for evaluatio Structure

More information

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

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE 1 Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates, and output

More information

Chapter 3 Part 2 Combinational Logic Design

Chapter 3 Part 2 Combinational Logic Design University of Wisconsin - Madison ECE/Comp Sci 352 Digital Systems Fundamentals Kewal K. Saluja and Yu Hen Hu Spring 2002 Chapter 3 Part 2 Combinational Logic Design Originals by: Charles R. Kime and Tom

More information

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

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book BUILDING BLOCKS OF A BASIC MICROPROCESSOR Part PowerPoint Format of Lecture 3 of Book Decoder Tri-state device Full adder, full subtractor Arithmetic Logic Unit (ALU) Memories Example showing how to write

More information

The Simeck Family of Lightweight Block Ciphers

The Simeck Family of Lightweight Block Ciphers The Simeck Family of Lightweight Block Ciphers Gagqiag Yag, Bo Zhu, Valeti Suder, Mark D. Aagaard, ad Guag Gog Electrical ad Computer Egieerig, Uiversity of Waterloo Sept 5, 205 Yag, Zhu, Suder, Aagaard,

More information

Parabolic Path to a Best Best-Fit Line:

Parabolic Path to a Best Best-Fit Line: Studet Activity : Fidig the Least Squares Regressio Lie By Explorig the Relatioship betwee Slope ad Residuals Objective: How does oe determie a best best-fit lie for a set of data? Eyeballig it may be

More information

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Itroductio to Computers ad C++ Programmig Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 1.1 Computer Systems 1.2 Programmig ad Problem Solvig 1.3 Itroductio to C++ 1.4 Testig

More information

A graphical view of big-o notation. c*g(n) f(n) f(n) = O(g(n))

A graphical view of big-o notation. c*g(n) f(n) f(n) = O(g(n)) ca see that time required to search/sort grows with size of We How do space/time eeds of program grow with iput size? iput. time: cout umber of operatios as fuctio of iput Executio size operatio Assigmet:

More information

Algorithm. Counting Sort Analysis of Algorithms

Algorithm. Counting Sort Analysis of Algorithms Algorithm Coutig Sort Aalysis of Algorithms Assumptios: records Coutig sort Each record cotais keys ad data All keys are i the rage of 1 to k Space The usorted list is stored i A, the sorted list will

More information

Examples and Applications of Binary Search

Examples and Applications of Binary Search Toy Gog ITEE Uiersity of Queeslad I the secod lecture last week we studied the biary search algorithm that soles the problem of determiig if a particular alue appears i a sorted list of iteger or ot. We

More information

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

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1 Lecture 1: VHDL Quick Start Digital Systems Design Fall 10, Dec 17 Lecture 1 1 Objective Quick introduction to VHDL basic language concepts basic design methodology Use The Student s Guide to VHDL or The

More information

Combinational Logic Circuits

Combinational Logic Circuits Combinational Logic Circuits By Dr. M. Hebaishy Digital Logic Design Ch- Rem.!) Types of Logic Circuits Combinational Logic Memoryless Outputs determined by current values of inputs Sequential Logic Has

More information

COP4020 Programming Languages. Compilers and Interpreters Prof. Robert van Engelen

COP4020 Programming Languages. Compilers and Interpreters Prof. Robert van Engelen COP4020 mig Laguages Compilers ad Iterpreters Prof. Robert va Egele Overview Commo compiler ad iterpreter cofiguratios Virtual machies Itegrated developmet eviromets Compiler phases Lexical aalysis Sytax

More information

Chapter 8. Strings and Vectors. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 8. Strings and Vectors. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 8 Strigs ad Vectors Overview 8.1 A Array Type for Strigs 8.2 The Stadard strig Class 8.3 Vectors Slide 8-3 8.1 A Array Type for Strigs A Array Type for Strigs C-strigs ca be used to represet strigs

More information

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level

More information

Contents. Appendix D Verilog Summary Page 1 of 16

Contents. Appendix D Verilog Summary Page 1 of 16 Appix D Verilog Summary Page 1 of 16 Contents Appix D Verilog Summary... 2 D.1 Basic Language Elements... 2 D.1.1 Keywords... 2 D.1.2 Comments... 2 D.1.3 Identifiers... 2 D.1.4 Numbers and Strings... 3

More information

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 3, RT-level

More information

University of Waterloo Department of Electrical and Computer Engineering ECE 250 Algorithms and Data Structures

University of Waterloo Department of Electrical and Computer Engineering ECE 250 Algorithms and Data Structures Uiversity of Waterloo Departmet of Electrical ad Computer Egieerig ECE 250 Algorithms ad Data Structures Midterm Examiatio ( pages) Istructor: Douglas Harder February 7, 2004 7:30-9:00 Name (last, first)

More information

VHDL Structural Modeling II

VHDL Structural Modeling II VHDL Structural Modeling II ECE-331, Digital Design Prof. Hintz Electrical and Computer Engineering 5/7/2001 331_13 1 Ports and Their Usage Port Modes in reads a signal out writes a signal inout reads

More information

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis Synthesis of Language Constructs 1 Nets Nets declared to be input or output ports are retained Internal nets may be eliminated due to logic optimization User may force a net to exist trireg, tri0, tri1

More information

Arithmetic Operators There are two types of operators: binary and unary Binary operators:

Arithmetic Operators There are two types of operators: binary and unary Binary operators: Verilog operators operate on several data types to produce an output Not all Verilog operators are synthesible (can produce gates) Some operators are similar to those in the C language Remember, you are

More information

Ones Assignment Method for Solving Traveling Salesman Problem

Ones Assignment Method for Solving Traveling Salesman Problem Joural of mathematics ad computer sciece 0 (0), 58-65 Oes Assigmet Method for Solvig Travelig Salesma Problem Hadi Basirzadeh Departmet of Mathematics, Shahid Chamra Uiversity, Ahvaz, Ira Article history:

More information

ELCT 501: Digital System Design

ELCT 501: Digital System Design ELCT 501: Digital System Lecture 4: CAD tools (Continued) Dr. Mohamed Abd El Ghany, Basic VHDL Concept Via an Example Problem: write VHDL code for 1-bit adder 4-bit adder 2 1-bit adder Inputs: A (1 bit)

More information

Online Verilog Resources

Online Verilog Resources EECS 427 Discussion 6: Verilog HDL Reading: Many references EECS 427 F08 Discussion 6 1 Online Verilog Resources ASICs the book, Ch. 11: http://www.ge.infn.it/~pratolo/verilog/verilogtutorial.pdf it/ pratolo/verilog/verilogtutorial

More information

MR-2010I %MktBSize Macro 989. %MktBSize Macro

MR-2010I %MktBSize Macro 989. %MktBSize Macro MR-2010I %MktBSize Macro 989 %MktBSize Macro The %MktBSize autocall macro suggests sizes for balaced icomplete block desigs (BIBDs). The sizes that it reports are sizes that meet ecessary but ot sufficiet

More information

Outline and Reading. Analysis of Algorithms. Running Time. Experimental Studies. Limitations of Experiments. Theoretical Analysis

Outline and Reading. Analysis of Algorithms. Running Time. Experimental Studies. Limitations of Experiments. Theoretical Analysis Outlie ad Readig Aalysis of Algorithms Iput Algorithm Output Ruig time ( 3.) Pseudo-code ( 3.2) Coutig primitive operatios ( 3.3-3.) Asymptotic otatio ( 3.6) Asymptotic aalysis ( 3.7) Case study Aalysis

More information

Lecture 1: Introduction and Strassen s Algorithm

Lecture 1: Introduction and Strassen s Algorithm 5-750: Graduate Algorithms Jauary 7, 08 Lecture : Itroductio ad Strasse s Algorithm Lecturer: Gary Miller Scribe: Robert Parker Itroductio Machie models I this class, we will primarily use the Radom Access

More information

Today s objectives. CSE401: Introduction to Compiler Construction. What is a compiler? Administrative Details. Why study compilers?

Today s objectives. CSE401: Introduction to Compiler Construction. What is a compiler? Administrative Details. Why study compilers? CSE401: Itroductio to Compiler Costructio Larry Ruzzo Sprig 2004 Today s objectives Admiistrative details Defie compilers ad why we study them Defie the high-level structure of compilers Associate specific

More information

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

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

COP4020 Programming Languages. Subroutines and Parameter Passing Prof. Robert van Engelen

COP4020 Programming Languages. Subroutines and Parameter Passing Prof. Robert van Engelen COP4020 Programmig Laguages Subrouties ad Parameter Passig Prof. Robert va Egele Overview Parameter passig modes Subroutie closures as parameters Special-purpose parameters Fuctio returs COP4020 Fall 2016

More information

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only Edited: Yeh-Liag Hsu (998--; recommeded: Yeh-Liag Hsu (--9; last updated: Yeh-Liag Hsu (9--7. Note: This is the course material for ME55 Geometric modelig ad computer graphics, Yua Ze Uiversity. art of

More information

Designing a learning system

Designing a learning system CS 75 Machie Learig Lecture Desigig a learig system Milos Hauskrecht milos@cs.pitt.edu 539 Seott Square, x-5 people.cs.pitt.edu/~milos/courses/cs75/ Admiistrivia No homework assigmet this week Please try

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 3: Modeling in VHDL VHDL: Overview 2 VHDL VHSIC Hardware Description Language VHSIC=Very High Speed Integrated Circuit Programming language for modelling of hardware

More information

Chapter 5: Processor Design Advanced Topics. Microprogramming: Basic Idea

Chapter 5: Processor Design Advanced Topics. Microprogramming: Basic Idea 5-1 Chapter 5 Processor Desig Advaced Topics Chapter 5: Processor Desig Advaced Topics Topics 5.3 Microprogrammig Cotrol store ad microbrachig Horizotal ad vertical microprogrammig 5- Chapter 5 Processor

More information

Chapter 8. Strings and Vectors. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 8. Strings and Vectors. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 8 Strigs ad Vectors Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 8.1 A Array Type for Strigs 8.2 The Stadard strig Class 8.3 Vectors Copyright 2015 Pearso Educatio, Ltd..

More information