Verilog HDL:Digital Design and Modeling. Chapter 4. Expressions

Size: px
Start display at page:

Download "Verilog HDL:Digital Design and Modeling. Chapter 4. Expressions"

Transcription

1 Chapter 4 Expressions 1 Verilog HDL:Digital Design and Modeling Chapter 4 Expressions

2 Chapter 4 Expressions 2 Page 120 //example of using a parameter module param1 (a, b, cin, sum); parameter width = 8; input [width-1:0] a, b; //a and b are 8 bits (7:0) input cin; //cin is a scalar output [width:0] sum; //sum is 9 bits (8:0) //to include cout //inputs default to wire reg [width:0] sum; (a or b or cin) sum = a + b + cin; Figure 4.2 Module for the 8-bit adder of Figure 4.1 illustrating the use of the parameter statement. //param1 test bench module param1_tb; parameter width = 8; reg [width-1:0] a, b; reg cin; wire [width:0] sum; //display variables $monitor ("a b cin = %b_%b_%b, sum = %b", a, b, cin, sum); //continued on next page Figure 4.3 Test bench for the module of Figure 4.2.

3 Chapter 4 Expressions 3 //apply input vectors #0 a = 8'b0000_0011; b = 8'b0000_0100; cin = 1'b0; #5 a = 8'b0000_1100; b = 8'b0000_0011; cin = 1'b0; #5 a = 8'b0000_0111; b = 8'b0000_0110; cin = 1'b1; #5 a = 8'b0001_1001; //25 (19h) b = 8'b0010_0111; //39 (27h) cin = 1'b1; //1. sum = 65 (41h) #5 a = 8'b0111_1101; //125 (7dh) b = 8'b0110_0111; //103 (67h) cin = 1'b1; //1. sum = 229 (e5h) #5 a = 8'b1000_1111; //143 (8fh) b = 8'b1100_0110; //198 (c6h) cin = 1'b1; //1. sum = 342 (156h) #5 $stop; //instantiate the module into the test bench param1 inst1 (.a(a),.b(b),.cin(cin),.sum(sum) ); Figure 4.3 (Continued)

4 Chapter 4 Expressions 4 Page 122 a b cin = _ _0, sum = a b cin = _ _0, sum = a b cin = _ _1, sum = a b cin = _ _1, sum = a b cin = _ _1, sum = a b cin = _ _1, sum = Figure 4.4 Outputs obtained from the test bench of Figure 4.3. Figure 4.5 Data analyzer waveforms for the test bench of Figure 4.4.

5 Chapter 4 Expressions 5 Page 128 //demonstrate arithmetic operations module arith_ops1 (a, b, opcode, rslt); input [3:0] a, b; input [2:0] opcode; output [7:0] rslt; reg [7:0] rslt; parameter addop = 3'b000, subop = 3'b001, mulop = 3'b010, divop = 3'b011, modop = 3'b100; (a or b or opcode) case (opcode) addop: rslt = a + b; subop: rslt = a - b; mulop: rslt = a * b; divop: rslt = a / b; modop: rslt = a % b; default: rslt = 8 bxxxxxxxx; case Figure 4.7 Verilog code illustrating the operations of addition, subtraction, multiplication, division, and modulus. //arithmetic operations test bench module arith_ops1_tb; reg [3:0] a, b; reg [2:0] opcode; wire [7:0] rslt ; //continued on next page Figure 4.8 Test bench for the module of Figure 4.7.

6 Chapter 4 Expressions 6 $monitor ("a = %b, b = %b, opcode = %b, rslt = %b", a, b, opcode, rslt); #0 a = 4'b0011; b = 4'b0111; opcode = 3'b000; #5 a = 4'b1111; b = 4'b1111; opcode = 3'b001; #5 a = 4'b1110; b = 4'b1110; opcode = 3'b010; #5 a = 4'b1000; b = 4'b0010; opcode = 3'b011; #5 a = 4'b0111; b = 4'b0011; opcode = 3'b100; #5 $stop; //instantiate the module into //the test bench arith_ops1 inst1 (.a(a),.b(b),.opcode(opcode),.rslt(rslt) ); Figure 4.8 (Continued) Page 129 a = 0011, b = 0111, opcode = 000, rslt = a = 1111, b = 1111, opcode = 001, rslt = a = 1110, b = 1110, opcode = 010, rslt = a = 1000, b = 0010, opcode = 011, rslt = a = 0111, b = 0011, opcode = 100, rslt = //add //subtract //multiply //divide //modulus Figure 4.9 Outputs for the test bench of Figure 4.8.

7 Chapter 4 Expressions 7 Page 130 Figure 4.10 Waveforms for the test bench of Figure 4.8. Page 130 //examples of logical operators module log_ops1 (a, b, z1, z2, z3); input [3:0] a, b; output z1, z2, z3; assign z1 = a && b; assign z2 = a b; assign z3 =!a; Figure 4.11 Examples of logical operators.

8 Chapter 4 Expressions 8 Page 131 //test bench for logical //operators module log_ops1_tb; reg [3:0] a, b; wire z1, z2, z3; $monitor ("z1 = %d, z2 = %d, z3 = %d", z1, z2, z3); //apply input vectors #0 a = 4'b0110; b = 4'b1100; #5 a = 4'b0101; b = 4'b0000; #5 a = 4'b1000; b = 4'b1001; #5 a = 4'b0000; b = 4'b0000; #5 a = 4'b1111; b = 4'b1111; #5 $stop; //instantiate the module //into the test bench log_ops1 inst1 (.a(a),.b(b),.z1(z1),.z2(z2),.z3(z3) ); Figure 4.12 Test bench for the logical operators module. z1 = 1, z2 = 1, z3 = 0 z1 = 0, z2 = 1, z3 = 0 z1 = 1, z2 = 1, z3 = 0 z1 = 0, z2 = 0, z3 = 1 z1 = 1, z2 = 1, z3 = 0 //z1 is logical AND //z2 is logical OR //z3 is logical negation Figure 4.13 Outputs for the logical operators obtained from the test bench of Figure Output z 1 is the logical AND; output z 2 is the logical OR; output z 3 is the logical negation.

9 Chapter 4 Expressions 9 Page 132 Figure 4.14 Waveforms for the logical operators obtained from the test bench of Figure Output z 1 is the logical AND; output z 2 is the logical OR; output z 3 is the logical negation. Pagw 133 //examples of relational operators module relational_ops1 (a, b, gt, lt, gte, lte); input [3:0] a, b; output gt, lt, gte, lte; assign gt = a > b; assign lt = a < b; assign gte = a >= b; assign lte = a <= b; Figure 4.15 Verilog module to illustrate the relational operators.

10 Chapter 4 Expressions 10 Page 133 //test bench relational ops module relational_ops1_tb; reg [3:0] a, b; wire gt, lt, gte, lte; $monitor ("a=%b, b=%b, gt=%d, lt=%d, gte=%d, lte=%d", a, b, gt, lt, gte, lte); b = 4'b1001; #5 a = 4'b0000; b = 4'b0000; #5 a = 4'b1111; b = 4'b1111; #5 $stop; //instantiate the module relational_ops1 inst1 (.a(a),.b(b),.gt(gt),.lt(lt),.gte(gte),.lte(lte) ); //apply input vectors #0 a = 4'b0110; b = 4'b1100; #5 a = 4'b0101; b = 4'b0000; #5 a = 4'b1000; Figure 4.16 Test bench for the relational operators module of Figure Page 134 a=0110, b=1100, gt=0, lt=1, gte=0, lte=1 a=0101, b=0000, gt=1, lt=0, gte=1, lte=0 a=1000, b=1001, gt=0, lt=1, gte=0, lte=1 a=0000, b=0000, gt=0, lt=0, gte=1, lte=1 a=1111, b=1111, gt=0, lt=0, gte=1, lte=1 Figure 4.17 Outputs for the test bench of Figure 4.16 for the relational operators. Figure 4.18 Waveforms for the test bench of Figure 4.16 for the relational operators.

11 Chapter 4 Expressions 11 Page 135 //illustrate the use of equality operators module equality (x1, x2, x3, x4, x5, z1, z2, z3, z4); input [3:0] x1, x2, x3, x4, x5; output z1, z2, z3, z4; wire x1, x2, x3, x4, x5; //z1 is logical equality //z2 is logical inequality //z3 is case equality //z4 is case inequality reg z1, z2, z3, z4; //can be omitted. //inputs are wire by default (x1 or x2 or x3 or x4 or x5) if (x1 == x2) //logical equality z1 = 1; else z1 = 0; (x1 or x2 or x3 or x4 or x5) if (x2!= x3) //logical inequality z2 = 1; else z2 = 0; (x1 or x2 or x3 or x4 or x5) if (x3 === x4) //case equality z3 = 1; else z3 = 0; (x1 or x2 or x3 or x4 or x5) if (x4!== x5) z4 = 1; else z4 = 0; Figure 4.19 Module to illustrate the use of the equality operators.

12 Chapter 4 Expressions 12 Page 136 //equality operators test bench module equality_tb; reg [3:0] x1, x2, x3, x4, x5; wire z1, z2, z3, z4; $monitor ("x1=%b, x2=%b, x3=%b, x4=%b, x5=%b, z1=%b, z2=%b, z3=%b, z4=%b", x1, x2, x3, x4, x5, z1, z2, z3, z4); //apply input vectors #0 x1 = 4'b1000; x2 = 4'b1101; x3 = 4'b01xz; x4 = 4'b01xz; x5 = 4'bx1xx; #10 x1 = 4'b1011; x2 = 4'b1011; x3 = 4'bx1xz; x4 = 4'bx1xz; x5 = 4'b11xx; #10 x1 = 4'b1100; x2 = 4'b0101; x3 = 4'bx10z; x4 = 4'b11xz; x5 = 4'b11xx; //instantiate the module into the test bench equality inst1 (.x1(x1),.x2(x2),.x3(x3),.x4(x4),.x5(x5),.z1(z1),.z2(z2),.z3(z3),.z4(z4) ); Figure 4.20 Test bench for the equality module of Figure 4.19.

13 Chapter 4 Expressions 13 Page 137 x1=1000, x2=1101, x3=01xz, x4=01xz, x5=x1xx, z1=0, z2=1, z3=1, z4=1 x1=1011, x2=1011, x3=x1xz, x4=x1xz, x5=11xx, z1=1, z2=1, z3=1, z4=1 x1=1100, x2=0101, x3=x01z, x4=11xz, x5=11xx, z1=0, z2=1, z3=0, z4=1 Outputs for the test bench of Figure 4.20 for the equality module of Fig- Figure 4.21 ure Page 141 //example of the bitwise operators module bitwise1 (a, b, and_rslt, or_rslt, neg_rslt, xor_rslt, xnor_rslt); input [7:0] a, b; output [7:0] and_rslt, or_rslt, neg_rslt, xor_rslt, xnor_rslt; wire [7:0] a, b; reg [7:0] and_rslt, or_rslt, neg_rslt, xor_rslt, xnor_rslt; (a or b) and_rslt = a & b; or_rslt = a b; neg_rslt = ~a; xor_rslt = a ^ b; xnor_rslt = a ^~ b; //bitwise AND //bitwise OR //bitwise negation //bitwise exclusive-or //bitwise exclusive-nor Figure 4.22 Module to illustrate the coding for the bitwise operators.

14 Chapter 4 Expressions 14 Page 142 //test bench for bitwise1 module module bitwise1_tb; reg [7:0] a, b; wire [7:0] and_rslt, or_rslt, neg_rslt, xor_rslt, xnor_rslt; $monitor ("a=%b, b=%b, and_rslt=%b, or_rslt=%b, neg_rslt=%b, xor_rslt=%b, xnor_rslt=%b", a, b, and_rslt, or_rslt, neg_rslt, xor_rslt, xnor_rslt); $monitor ("a=%b, b=%b, and_rslt=%b, or_rslt=%b, neg_rslt=%b, xor_rslt=%b, xnor_rslt=%b", a, b, and_rslt, or_rslt, neg_rslt, xor_rslt, xnor_rslt); //apply input vectors #0 a = 8'b1100_0011; b = 8'b1001_1001; #10 a = 8'b1001_0011; b = 8'b1101_1001; #10 a = 8'b0000_1111; b = 8'b1101_1001; #10 a = 8'b0100_1111; b = 8'b1101_1001; #10 a = 8'b1100_1111; b = 8'b1101_1001; #10 $stop; //instantiate the module into the test bench bitwise1 inst1 (.a(a),.b(b),.and_rslt(and_rslt),.or_rslt(or_rslt),.neg_rslt(neg_rslt),.xor_rslt(xor_rslt),.xnor_rslt(xnor_rslt) ); Figure 4.23 Test bench for the bitwise module of Figure 4.22.

15 Chapter 4 Expressions 15 Page 143 a = , b = , and_rslt = , or_rslt = , neg_rslt = , xor_rslt = , xnor_rslt= a = , b = , and_rslt = , or_rslt = , neg_rslt = , xor_rslt = , xnor_rslt= a = , b = , a = , b = , and_rslt = , or_rslt = , neg_rslt = , xor_rslt = , xnor_rslt= a = , b = , and_rslt = , or_rslt = , neg_rslt = , xor_rslt = , xnor_rslt= and_rslt = , or_rslt = , neg_rslt = , xor_rslt = , xnor_rslt= Figure 4.24 Outputs for the bitwise module of Figure 4.22.

16 Chapter 4 Expressions 16 Page 145 //module to illustrate the use of reduction operators module reduction (a, and_rslt, nand_rslt, or_rslt, nor_rslt, xor_rslt, xnor_rslt); input [7:0] a; output and_rslt, nand_rslt, or_rslt, nor_rslt, xor_rslt, xnor_rslt; wire [7:0] a; reg and_rslt, nand_rslt, or_rslt, nor_rslt, xor_rslt, xnor_rslt; and_rslt = &a; nand_rslt = ~&a; or_rslt = a; nor_rslt = ~ a; xor_rslt = ^a; xnor_rslt = ^~a; //reduction AND //reduction NAND //reduction OR //reduction NOR //reduction exclusive-or //reduction exclusive-nor Figure 4.25 Module to illustrate the use of the reduction operators. //test bench for reduction module module reduction_tb; reg [7:0] a; wire and_rslt, nand_rslt, or_rslt, nor_rslt, xor_rslt, xnor_rslt; $monitor ("a=%b, and_rslt=%b, nand_rslt=%b, or_rslt=%b, nor_rslt=%b, xor_rslt=%b, xnor_rslt=%b", a, and_rslt, nand_rslt, or_rslt, nor_rslt, xor_rslt, xnor_rslt); //continued on next page Figure 4.26 Test bench for the reduction operators of Figure 4.25.

17 Chapter 4 Expressions 17 //apply input vectors #0 a = 8'b1100_0011; #10 a = 8'b1001_0011; #10 a = 8'b0000_1111; #10 a = 8'b0100_1111; #10 a = 8'b1100_1111; #10 $stop; //instantiate the module into the test bench reduction inst1 (.a(a),.and_rslt(and_rslt),.nand_rslt(nand_rslt),.or_rslt(or_rslt),.nor_rslt(nor_rslt),.xor_rslt(xor_rslt),.xnor_rslt(xnor_rslt) ); Figure 4.26 (Continued) a= , and_rslt=0,nand_rslt=1,or_rslt=1,nor_rslt=0, xor_rslt=0,xnor_rslt=1 a= , and_rslt=0,nand_rslt=1,or_rslt=1,nor_rslt=0, xor_rslt=1,xnor_rslt=0 a= , and_rslt=0,nand_rslt=1,or_rslt=0,nor_rslt=1, xor_rslt=0,xnor_rslt=1 a= , and_rslt=0,nand_rslt=1,or_rslt=1,nor_rslt=0, xor_rslt=1,xnor_rslt=0 a= , and_rslt=1,nand_rslt=0,or_rslt=1,nor_rslt=0, xor_rslt=0,xnor_rslt=1 Figure 4.27 Outputs for the reduction operators of Figure 4.25.

18 Chapter 4 Expressions 18 Page 147 //examples of shift operations module shift (a_reg, b_reg, rslt_a, rslt_b); input [7:0] a_reg, b_reg; output [7:0] rslt_a, rslt_b; wire [7:0] a_reg, b_reg; reg [7:0] rslt_a, rslt_b; (a_reg or b_reg) rslt_a = a_reg << 3; //multiply by 8 rslt_b = b_reg >> 2; //divide by 4 Figure 4.28 Examples of shift-left and shift-right operators.

19 Chapter 4 Expressions 19 Page 148 //shift test bench module shift_tb; reg [7:0] a_reg, b_reg; wire [7:0] rslt_a, rslt_b; //display variables $monitor ("a_reg = %b, b_reg = %b, rslt_a = %b, rslt_b = %b", a_reg, b_reg, rslt_a, rslt_b); //apply input vectors #0 a_reg = 8'b0000_0010; //2; rslt_a = 16 b_reg = 8'b0000_1000; //8; rslt_b = 2 #10 a_reg = 8'b0000_0110; //6; rslt_a = 48 b_reg = 8'b0001_1000; //24; rslt_b = 6 #10 a_reg = 8'b0000_1111; //15; rslt_a = 120 b_reg = 8'b0011_1000; //56; rslt_b = 14 #10 a_reg = 8'b1110_0000; //224; rslt_a = 0 b_reg = 8'b0000_0011; //3; rslt_b = 0 #10 $stop; //instantiate the module into the test bench shift inst1 (.a_reg(a_reg),.b_reg(b_reg),.rslt_a(rslt_a),.rslt_b(rslt_b) ); Figure 4.29 Test bench for the shift operators of Figure 4.28.

20 Chapter 4 Expressions 20 Page 149 a_reg = , b_reg = , //shift a_reg left 3 rslt_a = , rslt_b = //shift b_reg right 2 a_reg = , b_reg = , //shift a_reg left 3 rslt_a = , rslt_b = //shift b_reg right 2 a_reg = , b_reg = , //shift a_reg left 3 rslt_a = , rslt_b = //shift b_reg right 2 a_reg = , b_reg = , //shift a_reg left 3 rslt_a = , rslt_b = //shift b_reg right 2 Figure 4.30 Outputs for the test bench of Figure 4.29 showing the results of the shiftleft and shift-right operations. Operand a_reg is shifted left three bits with the low-order bits filled with zeroes. Operand b_reg is shifted right two bits with the high-order bits filled with zeroes. Page 150 //dataflow 2:1 mux using conditional operator module mux_2to1_cond (s0, in0, in1, out); input s0, in0, in1; output out; assign out = s0? in1 : in0; // s0 out // 1(true) in1 // 0(false) in0 Figure 4.31 Verilog code to model a 2:1 multiplexer using the conditional operator.

21 Chapter 4 Expressions 21 Page 151 //2:1 multiplexer test bench module mux_2to1_cond_tb; reg s0, in0, in1; wire out; //display variables $monitor ("s0=%b, in0 in1=%b, out = %b", s0, {in0, in1}, out); //apply stimulus #0 s0 = 1'b0; in0 = 1'b0; in1 = 1'b0; #10 s0 = 1'b0; in0 = 1'b1; in1 = 1'b1; #10 s0 = 1'b1; in0 = 1'b1; in1 = 1'b0; #10 s0 = 1'b1; in0 = 1'b0; in1 = 1'b1; #10 $stop; //instantiate the module //into the test bench mux_2to1_cond inst1 (.s0(s0),.in0(in0),.in1(in1),.out(out) ); Figure 4.32 Test bench for the 2:1 multiplexer of Figure s0 = 0, in0 in1 = 00, out = 0 s0 = 0, in0 in1 = 11, out = 1 s0 = 1, in0 in1 = 10, out = 0 s0 = 1, in0 in1 = 01, out = 1 Figure 4.33 Outputs for the test bench of Figure 4.32.

22 Chapter 4 Expressions 22 Page 152 //examples of concatenation module concat (a, b, c, d, a_bus, z1, z2, z3, z4, z5, z6); input [1:0] a; input [2:0] b; input [3:0] c; input d; input [7:0] a_bus; output [9:0] z1, z2, z3, z4; output [7:0] z5; output [11:0] z6; assign z1 = {a, c}; assign z2 = {b, a}; assign z3 = {c, b, a}; assign z4 = {a, b, c, d}; assign z5 = {a_bus[3:0], a_bus[7:4]}; assign z6 = {b, c, d, 4 b0111}; Figure 4.34 Verilog module to demonstrate the use of the concatenation operator. //concatenation test bench module concat_tb; reg [1:0]a; reg [2:0]b; reg [3:0]c; reg d; reg [7:0] a_bus; wire [7:0] z5; wire [9:0] z1, z2, z3, z4; wire [11:0] z6; $monitor ("a=%b, b=%b, c=%b, d=%b, z1=%b, z2=%b, z3=%b, z4=%b, z5=%b, z6=%b", a, b, c, d, z1, z2, z3, z4, z5, z6); //continued on next page Figure 4.35 Test bench for the concatenation module of Figure 4.34.

23 Chapter 4 Expressions 23 #0 a = 2'b11; b = 3'b001; c = 4'b1100; d = 1'b1; a_bus = 8'b1111_0000; #10 $stop; //instantiate the module into the test bench concat inst1 (.a(a),.b(b),.c(c),.d(d),.a_bus(a_bus),.z1(z1),.z2(z2),.z3(z3),.z4(z4),.z5(z5),.z6(z6) ); Figure 4.35 (Continued) z1, z2, z3, and z4 are 10 bits in length. a = 11, b = 001, c = 1100, d = 1 a_bus = z1 = 0000_11_1100 //z1 = {a, c} z2 = 00000_001_11 //z2 = {b, a} z3 = 0_1100_001_11 //z3 = {c, b, a} z4 = 11_001_1100_1 //z4 = {a, b, c, d} z5 = 0000_1111 //z5 = {a_bus [3:0], a_bus [7:4]} z6 = 001_1100_1_0111 //z6 = {b, c, d, 4 b0111} Figure 4.36 Outputs for the concatenation test bench of Figure 4.35.

24 Chapter 4 Expressions 24 Page 154 //example of replication module replication (a, b, c, z1, z2); input [1:0] a; input [2:0] b; input [3:0] c; output [11:0] z1; output [21:0] z2; assign z1 = {2{a, c}}; assign z2 = {2{b, c, 4'b0111}}; Figure 4.37 Module to illustrate the replication operator.

25 Chapter 4 Expressions 25 Page 155 //replication test bench module replication_tb; reg [1:0] a; reg [2:0] b; reg [3:0] c; wire [11:0] z1; wire [21:0] z2; $monitor ("a=%b, b=%b, c=%b, z1=%b, z2=%b", a, b, c, z1, z2); #0 a = 2'b11; b = 3'b010; c = 4'b0011; #10 $stop; //instantiate the module into the test bench replication inst1 (.a(a),.b(b),.c(c),.z1(z1),.z2(z2) ); Figure 4.38 Test bench for the replication module of Figure Page 156 a = 11, b = 010, c = 0011, z1 = 11_0011_11_0011, //z1 = {2{a, c}} z2 = 010_0011_0111_010_0011_0111 //z2 = {2{b, c, 4'b0111}} Figure 4.39 Outputs for the replication test bench of Figure 4.38.

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

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

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers ECE 601 - Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers Fall 2001 Final Version (Important changes from original posted Exercise 1 shown in color) Variables

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

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

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

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

Chap 6 - Introduction to HDL (b)

Chap 6 - Introduction to HDL (b) Design with Verilog Chap 6 - Introduction to HDL (b) Credit to: MD Rizal Othman Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang Ext: 6036 Language Elements 1. Operators There

More information

Course Topics - Outline

Course Topics - Outline Course Topics - Outline Lecture 1 - Introduction Lecture 2 - Lexical conventions Lecture 3 - Data types Lecture 4 - Operators Lecture 5 - Behavioral modeling A Lecture 6 Behavioral modeling B Lecture 7

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

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

Introduction to Digital VLSI Design מבוא לתכנון VLSI ספרתי

Introduction to Digital VLSI Design מבוא לתכנון VLSI ספרתי Design מבוא לתכנון VLSI ספרתי Verilog Dataflow Modeling Lecturer: Semester B, EE Dept. BGU. Freescale Semiconductors Israel 9/3/7 Objectives Describe the continuous assignment ( assign ) statement, restrictions

More information

Lab 5: Arithmetic Logic Unit (ALU)

Lab 5: Arithmetic Logic Unit (ALU) Lab 5: Arithmetic Logic Unit (ALU) September 29, 2009 Contents 1 Prelab 4 2 Lab 4 3 Supplementary Material 6 3.1 Verilog................................................. 6 3.1.1 Parameters..........................................

More information

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26) Lecture Topics Today: Integer Arithmetic (P&H 3.1-3.4) Next: continued 1 Announcements Consulting hours Introduction to Sim Milestone #1 (due 1/26) 2 1 Overview: Integer Operations Internal representation

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

Brief Introduction to Verilog HDL (Part 1)

Brief Introduction to Verilog HDL (Part 1) BUDAPEST UNIVERSITY OF TECHNOLOGY AND ECONOMICS FACULTY OF ELECTRICAL ENGINEERING AND INFORMATICS DEPARTMENT OF MEASUREMENT AND INFORMATION SYSTEMS Brief Introduction to Verilog HDL (Part 1) Tamás Raikovich

More information

Under-Graduate Project Logic Design with Behavioral Models

Under-Graduate Project Logic Design with Behavioral Models 97-1 1 Under-Graduate Project Logic Design with Behavioral Models Speaker: 吳佳謙 Adviser: Prof. An-Yeu Wu Date: 2008/10/20 ACCESS IC LAB Operation Assignment Outline Blocking and non-blocking Appendix pp.

More information

Verilog HDL:Digital Design and Modeling. Chapter 3. Keywords

Verilog HDL:Digital Design and Modeling. Chapter 3. Keywords Chapter 3 Keywords 1 Verilog HDL:Digital Design and Modeling Chapter 3 Keywords Chapter 3 Keywords 2 Page 80 //4:1 multiplexer using a //case statement module mux_4_1_case (sel, data, out); input [1:0]

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

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

N-input EX-NOR gate. N-output inverter. N-input NOR gate Hardware Description Language HDL Introduction HDL is a hardware description language used to design and document electronic systems. HDL allows designers to design at various levels of abstraction. It

More information

ECE 4514 Digital Design II. Spring Lecture 7: Dataflow Modeling

ECE 4514 Digital Design II. Spring Lecture 7: Dataflow Modeling ECE 4514 Digital Design II Lecture 7: Dataflow Modeling A language Lecture Today's topic Dataflow Modeling input input input module output output Model with submodules and gates = Structural Model with

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

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators JAVA Standard Edition Java - Basic Operators Java provides a rich set of operators to manipulate variables.

More information

Digital Design (VIMIAA01) Introduction to the Verilog HDL

Digital Design (VIMIAA01) Introduction to the Verilog HDL BUDAPEST UNIVERSITY OF TECHNOLOGY AND ECONOMICS FACULTY OF ELECTRICAL ENGINEERING AND INFORMATICS DEPARTMENT OF MEASUREMENT AND INFORMATION SYSTEMS Digital Design (VIMIAA01) Introduction to the Verilog

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

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

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified. 1 In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified. I will also introduce the idea of a testbench as part of a design specification.

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

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one. http://www.tutorialspoint.com/go/go_operators.htm GO - OPERATORS Copyright tutorialspoint.com An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.

More information

Department of Computer Science and Electrical Engineering. Intro to Verilog II

Department of Computer Science and Electrical Engineering. Intro to Verilog II Department of Computer Science and Electrical Engineering Intro to Verilog II http://6004.csail.mit.edu/6.371/handouts/l0{2,3,4}.pdf http://www.asic-world.com/verilog/ http://www.verilogtutorial.info/

More information

Verilog HDL:Digital Design and Modeling. Chapter 11. Additional Design Examples

Verilog HDL:Digital Design and Modeling. Chapter 11. Additional Design Examples Chapter 11 Additional Design Examples 1 Verilog HDL:Digital Design and Modeling Chapter 11 Additional Design Examples Chapter 11 Additional Design Examples 2 Page 604 //structural 3-bit johnson counter

More information

ECEN 468 Advanced Digital System Design

ECEN 468 Advanced Digital System Design ECEN 468 Advanced Digital System Design Lecture 19: Logic Design with Verilog Verilog Module v Description of internal structure/function o Implicit semantic of time associated with each data object/ signal

More information

Experiment 7 Arithmetic Circuits Design and Implementation

Experiment 7 Arithmetic Circuits Design and Implementation Experiment 7 Arithmetic Circuits Design and Implementation Introduction: Addition is just what you would expect in computers. Digits are added bit by bit from right to left, with carries passed to the

More information

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

Introduction to Verilog. Garrison W. Greenwood, Ph.D, P.E. Introduction to Verilog Garrison W. Greenwood, Ph.D, P.E. November 11, 2002 1 Digital Design Flow Specification Functional Design Register Transfer Level Design Circuit Design Physical Layout Production

More information

EN2911X: Reconfigurable Computing Lecture 05: Verilog (2)

EN2911X: Reconfigurable Computing Lecture 05: Verilog (2) EN2911X: Lecture 05: Verilog (2) Prof. Sherief Reda Division of Engineering, Brown University Fall 09 http://scale.engin.brown.edu Dataflow modeling Module is designed by specifying the data flow, where

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

LAB K Basic Verilog Programming

LAB K Basic Verilog Programming LAB K Basic Verilog Programming Perform the following groups of tasks: LabK1.v 1. Create a directory to hold the files of this lab. 2. Launch your favourite editor and a command-prompt console; you will

More information

yamin/

yamin/ http://cis.k.hosei.ac.jp/ yamin/ Verilog HDL p.1/76 HDL Verilog HDL IEEE Standard 1364-1995 (Verilog-1995) IEEE Standard 1364-2001 (Verilog-2001) VHDL VHSIC HDL IEEE Standard 1076-1987 AHDL Altera HDL

More information

VERILOG 2: LANGUAGE BASICS

VERILOG 2: LANGUAGE BASICS VERILOG 2: LANGUAGE BASICS Verilog module Modules are basic building blocks. These are two example module definitions which you should use: // Safer traditional method module abc (in1, in2, out); input

More information

Last Lecture: Adder Examples

Last Lecture: Adder Examples Last Lecture: Adder Examples module fulladder(input logic a, b, cin, output logic s, cout); logic p, g; // internal nodes assign p = a ^ b; assign g = a & b; assign s = p ^ cin; assign cout = g (p & cin);

More information

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26) Lecture Topics Today: Integer Arithmetic (P&H 3.1-3.4) Next: The MIPS ISA (P&H 2.1-2.14) 1 Announcements Consulting hours Milestone #1 (due 1/26) Milestone #2 (due 2/2) 2 1 Review: Integer Operations Internal

More information

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016 ECE 353 Lab 4 Verilog Review Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016 Recall What You Will Do Design and implement a serial MIDI receiver Hardware in

More information

L3: Introduction to Verilog (Combinational Logic)

L3: Introduction to Verilog (Combinational Logic) L3: Introduction to Verilog (Combinational Logic) Courtesy of Rex in. Used with permission. Verilog References: Samir Palnitkar, Verilog HDL, Pearson Education (2nd edition). Donald Thomas, Philip oorby,

More information

Course Topics - Outline

Course Topics - Outline Course Topics - Outline Lecture 1 - Introduction Lecture 2 - Lexical conventions Lecture 3 - Data types Lecture 4 - Operators Lecture 5 - Behavioral modeling A Lecture 6 Behavioral modeling B Lecture 7

More information

Introduction To Verilog Design. Chun-Hung Chou

Introduction To Verilog Design. Chun-Hung Chou Introduction To Verilog Design Chun-Hung Chou 1 Outline Typical Design Flow Design Method Lexical Convention Data Type Data Assignment Event Control Conditional Description Register Description Synthesizable

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

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb UMass Amherst Fall 2017

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb UMass Amherst Fall 2017 ECE 353 Lab 4 Verilog Review Professor Daniel Holcomb UMass Amherst Fall 2017 What You Will Do In Lab 4 Design and implement a serial MIDI receiver Hardware in an Altera Complex Programmable Logic Device

More information

Lab 4: Arithmetic Logic Unit (ALU)

Lab 4: Arithmetic Logic Unit (ALU) EE 231-1 - Fall 2016 Lab 4: Arithmetic Logic Unit (ALU) Introduction The heart of every computer is an Arithmetic Logic Unit (ALU). This is the part of the computer which performs arithmetic operations

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

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture) Last Lecture The basic component of a digital circuit is the MOS transistor Transistor have instrinsic resistance and capacitance, so voltage values in the circuit take some time to change ( delay ) There

More information

EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2

EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2 EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2 Professor Sherief Reda http://scaleenginbrownedu Electrical Sciences and Computer Engineering School of Engineering Brown University

More information

REGISTER TRANSFER LANGUAGE

REGISTER TRANSFER LANGUAGE REGISTER TRANSFER LANGUAGE The operations executed on the data stored in the registers are called micro operations. Classifications of micro operations Register transfer micro operations Arithmetic micro

More information

register:a group of binary cells suitable for holding binary information flip-flops + gates

register:a group of binary cells suitable for holding binary information flip-flops + gates 9 차시 1 Ch. 6 Registers and Counters 6.1 Registers register:a group of binary cells suitable for holding binary information flip-flops + gates control when and how new information is transferred into the

More information

Parallel logic circuits

Parallel logic circuits Computer Mathematics Week 9 Parallel logic circuits College of Information cience and Engineering Ritsumeikan University last week the mathematics of logic circuits the foundation of all digital design

More information

L3: Introduction to Verilog (Combinational Logic)

L3: Introduction to Verilog (Combinational Logic) L3: Introduction to Verilog (Combinational Logic) Acknowledgements: aterials in this lecture are courtesy of the following sources and are used with permission. Rex in Verilog References: Samir Palnitkar,

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

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

Register Transfer Language and Microoperations (Part 2)

Register Transfer Language and Microoperations (Part 2) Register Transfer Language and Microoperations (Part 2) Adapted by Dr. Adel Ammar Computer Organization 1 MICROOPERATIONS Computer system microoperations are of four types: Register transfer microoperations

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

Lecture 32: SystemVerilog

Lecture 32: SystemVerilog Lecture 32: SystemVerilog Outline SystemVerilog module adder(input logic [31:0] a, input logic [31:0] b, output logic [31:0] y); assign y = a + b; Note that the inputs and outputs are 32-bit busses. 17:

More information

Lecture #2: Verilog HDL

Lecture #2: Verilog HDL Lecture #2: Verilog HDL Paul Hartke Phartke@stanford.edu Stanford EE183 April 8, 2002 EE183 Design Process Understand problem and generate block diagram of solution Code block diagram in verilog HDL Synthesize

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

DIGITAL SYSTEM DESIGN

DIGITAL SYSTEM DESIGN DIGITAL SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING Digital System Design 1 Name: Registration No: Roll No: Semester:

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

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

Verilog. Verilog for Synthesis

Verilog. Verilog for Synthesis Verilog Verilog for Synthesis 1 Verilog background 1983: Gateway Design Automation released Verilog HDL Verilog and simulator 1985: Verilog enhanced version Verilog-XL 1987: Verilog-XL becoming more popular

More information

A Brief Introduction to Verilog Hardware Definition Language (HDL)

A Brief Introduction to Verilog Hardware Definition Language (HDL) www.realdigital.org A Brief Introduction to Verilog Hardware Definition Language (HDL) Forward Verilog is a Hardware Description language (HDL) that is used to define the structure and/or behavior of digital

More information

Combinational Circuits

Combinational Circuits Combinational Circuits In this post, realization of various basic combinational circuits using Verilog is discussed. There is no need to discuss the theory behind the combinational blocks. More about the

More information

Introduction to Boole algebra. Binary algebra

Introduction to Boole algebra. Binary algebra Introduction to Boole algebra Binary algebra Boole algebra George Boole s book released in 1847 We have only two digits: true and false We have NOT, AND, OR, XOR etc operations We have axioms and theorems

More information

Processor (I) - datapath & control. Hwansoo Han

Processor (I) - datapath & control. Hwansoo Han Processor (I) - datapath & control Hwansoo Han Introduction CPU performance factors Instruction count - Determined by ISA and compiler CPI and Cycle time - Determined by CPU hardware We will examine two

More information

Verilog Module 1 Introduction and Combinational Logic

Verilog Module 1 Introduction and Combinational Logic Verilog Module 1 Introduction and Combinational Logic Jim Duckworth ECE Department, WPI 1 Module 1 Verilog background 1983: Gateway Design Automation released Verilog HDL Verilog and simulator 1985: Verilog

More information

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi Digital System Design Verilog-Part III Amir Masoud Gharehbaghi amgh@mehr.sharif.edu Procedural Blocks initial block always block Place in module body Run concurrently with other module constructs Continuous

More information

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic Question 1: Due October 19 th, 2009 A convenient shorthand for specifying

More information

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

Lecture 2: Data Types, Modeling Combinational Logic in Verilog HDL. Variables and Logic Value Set. Data Types. Why use an HDL? Why use an HDL? Lecture 2: Data Types, Modeling Combinational Logic in Verilog HDL Increase digital design engineer s productivity (from Dataquest) Behavioral HDL RTL HDL Gates Transistors 2K 10K gates/week

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

Unit-2 (Operators) ANAND KR.SRIVASTAVA

Unit-2 (Operators) ANAND KR.SRIVASTAVA Unit-2 (Operators) ANAND KR.SRIVASTAVA 1 Operators in C ( use of operators in C ) Operators are the symbol, to perform some operation ( calculation, manipulation). Set of Operations are used in completion

More information

Arithmetic and Logic Blocks

Arithmetic and Logic Blocks Arithmetic and Logic Blocks The Addition Block The block performs addition and subtractions on its inputs. This block can add or subtract scalar, vector, or matrix inputs. We can specify the operation

More information

ECE 353 Lab 3 (Verilog Design Approach)

ECE 353 Lab 3 (Verilog Design Approach) ECE 353 Lab 3 (Verilog Design Approach) Prof Daniel Holcomb Recall What You Will Do Design and implement a serial MIDI receiver Hardware in an Altera Complex Programmable Logic Device (CPLD) MAX 7000S

More information

Department of Computer Science

Department of Computer Science Department of Computer Science Definition An operator is a symbol (+,-,*,/) that directs the computer to perform certain mathematical or logical manipulations and is usually used to manipulate data and

More information

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

Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog Module in Verilog A module definition always begins with the keyword module. The module name, port list, port declarations, and optional

More information

Verilog Design Principles

Verilog Design Principles 16 h7fex // 16-bit value, low order 4 bits unknown 8 bxx001100 // 8-bit value, most significant 2 bits unknown. 8 hzz // 8-bit value, all bits high impedance. Verilog Design Principles ECGR2181 Extra Notes

More information

Register Transfer Level in Verilog: Part I

Register Transfer Level in Verilog: Part I Source: M. Morris Mano and Michael D. Ciletti, Digital Design, 4rd Edition, 2007, Prentice Hall. Register Transfer Level in Verilog: Part I Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National

More information

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

!#$%&&'(')*+%,%-.#'/'.001$$ !"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"!!"#$%&'#()#*+"+#,-."/0110#230#4."50",+"+#)6# 6+-+#(.6+-0#)4475.8)60#0/#.65-0#230#9+**+"+# 2.48).-0#(.6+-0#! 2+"*5."5*:#,."/0110#;)**0! *),".6*:#-.99-0*0"5."+#2+660,.40"5)#;)*)2)#

More information

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1 Module 4 Design of Embedded Processors Version 2 EE IIT, Kharagpur 1 Lesson 23 Introduction to Hardware Description Languages-III Version 2 EE IIT, Kharagpur 2 Instructional Objectives At the end of the

More information

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems. REGISTER TRANSFER AND MICROOPERATIONS Register Transfer Language Register Transfer Bus and Memory Transfers Arithmetic Microoperations Logic Microoperations Shift Microoperations Arithmetic Logic Shift

More information

Tutorial on Verilog HDL

Tutorial on Verilog HDL Tutorial on Verilog HDL HDL Hardware Description Languages Widely used in logic design Verilog and VHDL Describe hardware using code Document logic functions Simulate logic before building Synthesize code

More information

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( ) 6. Combinational Circuits George Boole (85 864) Claude Shannon (96 2) Signals and Wires Digital signals Binary (or logical ) values: or, on or off, high or low voltage Wires. Propagate digital signals

More information

IT T35 Digital system desigm y - ii /s - iii

IT T35 Digital system desigm y - ii /s - iii UNIT - V Introduction to Verilog Hardware Description Language Introduction HDL for combinational circuits Sequential circuits Registers and counters HDL description for binary multiplier. 5.1 INTRODUCTION

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 3, 2015 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages Professor Sherief Reda http://scale.engin.brown.edu School of Engineering Brown University Spring 2014 1 Introduction to Verilog

More information

CHAPTER 4: Register Transfer Language and Microoperations

CHAPTER 4: Register Transfer Language and Microoperations CS 224: Computer Organization S.KHABET CHAPTER 4: Register Transfer Language and Microoperations Outline Register Transfer Language Register Transfer Bus and Memory Transfers Arithmetic Microoperations

More information

Using Library Modules in Verilog Designs

Using Library Modules in Verilog Designs Using Library Modules in Verilog Designs This tutorial explains how Altera s library modules can be included in Verilog-based designs, which are implemented by using the Quartus R II software. Contents:

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 2, 2016 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Verilog for Combinational Circuits

Verilog for Combinational Circuits Verilog for Combinational Circuits Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2014 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/

More information

VLSI Design 13. Introduction to Verilog

VLSI Design 13. Introduction to Verilog Last module: Sequential circuit design Design styles This module Synthesis Brief introduction to Verilog Synthesis in the Design Flow Designer Tasks Tools Architect Logic Designer Circuit Designer Define

More information

UNIT V: SPECIFICATION USING VERILOG HDL

UNIT V: SPECIFICATION USING VERILOG HDL UNIT V: SPECIFICATION USING VERILOG HDL PART -A (2 Marks) 1. What are identifiers? Identifiers are names of modules, variables and other objects that we can reference in the design. Identifiers consists

More information

Operators in java Operator operands.

Operators in java Operator operands. Operators in java Operator in java is a symbol that is used to perform operations and the objects of operation are referred as operands. There are many types of operators in java such as unary operator,

More information

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

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed. VLSI SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING VLSI System Design 1 LAB 01 Schematic Introduction to DSCH and

More information

REGISTER TRANSFER AND MICROOPERATIONS

REGISTER TRANSFER AND MICROOPERATIONS 1 REGISTER TRANSFER AND MICROOPERATIONS Register Transfer Language Register Transfer Bus and Memory Transfers Arithmetic Microoperations Logic Microoperations Shift Microoperations Arithmetic Logic Shift

More information

Lab #1. Topics. 3. Introduction to Verilog 2/8/ Programmable logic. 2. Design Flow. 3. Verilog --- A Hardware Description Language

Lab #1. Topics. 3. Introduction to Verilog 2/8/ Programmable logic. 2. Design Flow. 3. Verilog --- A Hardware Description Language Lab #1 Lecture 8, 9, &10: FPGA Dataflow and Verilog Modeling February 9, 11, 13, 2015 Prof R Iris Bahar Lab #1 is posted on the webpage wwwbrownedu/departments/engineering/courses/engn1640 Note for problem

More information

ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators

ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators ESCI 386 IDL Programming for Advanced Earth Science Applications Lesson 1 IDL Operators ARITHMATIC OPERATORS The assignment operator in IDL is the equals sign, =. IDL uses all the familiar arithmetic operators

More information

Chapter 3 Part 2 Combinational Logic Design

Chapter 3 Part 2 Combinational Logic Design University of Wisconsin - Madison EE/omp ci 352 Digital ystems Fundamentals Kewal K. aluja and u Hen Hu pring 2002 hapter 3 Part 2 ombinational Logic Design Originals by: harles R. Kime and Tom Kamisnski

More information