Course Topics - Outline

Size: px
Start display at page:

Download "Course Topics - Outline"

Transcription

1 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 Behavioral modeling C Lecture 8 Data flow modeling Lecture 9 Gate Level modeling Lecture 10 Tasks and Functions Lecture 11 Advanced Modeling Techniques Lecture 12 - Coding Styles and Test Benches Lecture 13 - Switch Level modeling 1

2 Expressions and Operands Operators Types Bus Operators Arithmetic Operators Bitwise Operators Reduction Operators Logical Operators Relational Operators Conditional Operator Operators Precedence Signed arithmetic Exercise 4 Lecture 4 - Operators 2

3 3 Expressions and Operands Expressions are constructs that combine operators and operands to produce a result. Operands can be any one of the data types defined in the previous lecture: integers real numbers nets registers times bit-select (one bit of vector net or vector register) part select (selected bits of vector net or vector register) memories function calls (discussed later)

4 4 Operators Operators are of three types: Unary Binary Ternary Unary operators precede the operand Binary operators appear between two operands Ternary operators have two separate operators that separate three operands a = ~ b ; // ~ is a unary operator. b is the operand a = b && c ; // && is the binary operator. a and b are operands a = b? c : d ; //?: is a ternary operator. b, c and d are operands

5 Operators Types Bus Operators Arithmetic Operators Bitwise Operators Reduction Operators Logical Operators Relational Operators Conditional Operator 5

6 Bus Operators A = 8'b Operator [ ] { } {{ }} << >> >>> 6 Description Bit/Part Select Concatenation Replication Shift left logical Shift right logical Shift right arithmetic Example A[0] = 1'b1; A[5:2] = 4'b0010 ; {A[5:2],A[7:6],2'b01} = 8'b {3{A[7:6]}} = 6'b A<<2 = 8'b A>>3 = 8 b A>>>3 = 8 b

7 Arithmetic Operators A = 8'b = 139 B = 8 b = 12 Operator + - * / % Description Addition Subtraction Multiplication Division Modulus Example A + 12 = 151 = 8 b A 10 = 129 = 8 b A * 3 = 417 = 9 b A / 2 = 69 = 7'b A % 5 = 4 = 3'b100 ** Power (exponent) B ** 2 = 144 = 8'b

8 Bitwise Operators A = 8'b Operator ~ & ^ ~^ Description Inverse / NOT AND OR XOR XNOR Example ~A = 8'b A[2] & A[1] = 1'b0 A[2] A[1] = 1'b1 A[2] ^ A[1] = 1'b1 A[2] ~^ A[1] = 1'b0 8

9 Reduction Operators A = 8'b Operator Description Example & ~& ~ ^ AND NAND OR NOR XOR &A = A[0] & A[1] & A[7] = 1'b0 ~&A = ~(A[0] & A[1] & A[7]) = 1'b1 A = A[0] A[1] A[7] = 1'b1 ~ A = ~(A[0] A[1] A[7]) = 1'b0 ^A = A[0] ^ A[1] ^ A[7] = 1'b0 ~^ XNOR ~^A = ~(A[0] ^ A[1] ^ A[7]) = 1'b1 9

10 Logical Operators A = 8'b Operator Description Example! && ==!= NOT AND OR EQUAL NOT EQUAL!A[1] = FALSE,!A[2] = TRUE A[0] && A[1] = TRUE A[0] A[2] = TRUE A[3:0] == 4'b1011 = TRUE A[3:0]!= 4'b1011 = FALSE <,<=,>,>= COMPARE A[3:0] < 13 = TRUE 10

11 11 Relational Operators >, >=, <, <= : Determine relative value. Registers and nets are treated as unsigned. Real and Integer operands, may be signed. If any bit is unknown, the result will be unknown. Result is one bit value: 0, 1 or X ==,!= : Logical equality, inequality. Registers and nets are treated as unsigned. Real and Integer operands, may be signed. If any bit is unknown (or highimpedance), the result will be unknown. 1-bit result 0,1 or X ===,!== : case equality, inequality. The bitwise comparison includes X and Z values. All bits must match for equality. The result is either True or False. 4 b 110Z == 4 b110z => FALSE 4 b 110Z === 4 b 110Z => TRUE

12 12 Conditional Operator The conditional operator (?:) can be used in place of the if statement when one of two values is to be selected for assignment. The general form of the conditional operator is: :: = <cond_expression>? <true_expr> : <false_expr> If the first expression is TRUE, then the value of the operator is the second expression. Otherwise the value is the third expression. May be a part of a procedural or continuous statement. Conditional operator can be used both in behavioral and gate level structural modeling. A 1 Example: 2-to-1 MUX Y Y = (sel)? A : B ; B 0 sel

13 13 Operators Operators Precedence If no parentheses are used to separate operands then Verilog uses the following rules of precedence: (good practice: use parentheses) Unary Multiply, Divide, Modulus Add, Subtract Shift Relational Equality Reduction Logical Conditional Operators Symbols + -! ~ * / % + - << >> >>> < <= > >= ==!= ===!== &, ~&, ^, ^~,, ~ &&?: Highest Precedence Lowest Precedence

14 14 Signed data types For integer math operations, data types of the operands are used to determine if signed or unsigned arithmetic should be performed. To perform signed arithmetic, both operands must be signed. If any operand in an expression is unsigned, unsigned operations are performed. Verilog 1995 provides only one signed data type, 32bits integer. reg and net data types are unsigned. The rule still applies for Verilog 2001 but now all regs, wires and ports can be declared as signed. Sized numbers, bit and part select results and concatenation, yield unsigned values.

15 15 Signed arithmetic Verilog 2001 extensions Verilog 2001 provides a new specifier, the letter s that can be combined with the radix specifier to indicate that the literal number (sized value) is a signed value. For example, 2 represented as a 3-bit signed hex value would be specified as 3 sh2. Somewhat confusing is specifying negative signed values. The value -4 represented as a 3-bit signed hex value would be specified as -3 sh4. A decimal number is always signed. Function return values can be declared as signed. Operands can be converted from unsigned to signed, using system functions as casting operators, $unsigned and $signed.

16 Type Casting Operands can be converted from unsigned to signed, using system functions as casting operators, $unsigned and $signed. The casting operators, $unsigned and $signed, have effect only when casting a smaller bit width to a larger bit. Casting using $unsigned(signal_name) will zero fill the input. For example A = $unsigned(b) will zero fill B and assign it to A. Casting using $signed(signal_name) will sign extend the input. For example, A = $signed(b). If the sign bit is X or Z the value will be sign extended using X or Z, respectively. 16

17 17 Signed declarations examples reg signed [63:0] data ; wire signed [7:0] vector ; input signed [31:0] a ; function signed [128:0] alu ; integer i : // 32 bit signed value 16'hC501 // an unsigned 16-bit hex value 16'shC501 // a signed 16-bit hex value reg [63:0] a; // unsigned data type begin result1 = a / 2; //unsigned arithmetic result2 = $signed(a) / 2; //signed arithmetic end

18 18 Signed Addition and Signed Multiplication module add_signed_2001 ( input signed [2:0] A, input signed [2:0] B, output signed [3:0] Sum) ; assign Sum = A + B ; endmodule module mult_signed_2001 ( input signed [2:0] a, input signed [2:0] b, output signed [5:0] prod) ; assign prod = a*b ; endmodule

19 19 MIPS 5-stage pipeline Architecture

20 MIPS Instruction Set Architecture (ISA) I type instructions have opcode, address of 1 operand, address of destination result and a 16bits Constant (imm). Imm should be sign extended to 32bits signed number for addi. Imm should be zero extended to 32bits signed number for ori. Sh 5bits shift amount for shift operations 20

21 MIPS Instructions Set Category Name syntax Meaning Format/Opcode/Func Notes Arithmet ic Add add $d,$s,$t $d=$s+$t R 0 20h Signed operands Sub sub $d,$s,$t $d=$s-$t R 0 22h Signed operands Addi addi $t,$s,c $t=$s+ C (signed) I 8 - Signed operands Logical Or or $d,$s,$t $d=$s $t R 0 25h Unsigned operands Ori ori $t,$s,c $t = $s C I Dh - Unsigned operands Bitwise Shift Shleft logical sll $d,$t,sh $d=$t<<sh R 0 0 Unsigned operands Sright logical srl $d,$t,sh $d=$t>>sh R 0 2 Unsigned operands 21 Sright arithm sra $d,$t,sh $d=$t>>>sh R 0 3 Unsigned operands

22 MIPS Execution Unit Block Diagram rf_do1 1 st operand 32 shamt zero sh_extend 5 extend extended 32 shift amount rf_do2 2 nd operand 32 0 imm z_s extend Imm_extend z_s sel2 0 1 MUX MUX 32 sel1 32 in1 in2 ctrl ALU result 32 op 3 ALUop 22

23 23 MIPS / ALU Instructions Instructions: Signed Operations: 1. add (signed) : result = in1 + in2 ; 2. sub (signed) : result = in1 - in2 ; 3. addi (signed) : result = in1 + imm ; Unsigned Operations: 4. or (bitwise logic) : result = in1 in2 ; 5. ori (bitwise logic) : result = in1 imm ; 6. shift left logical (sll): result = in2 << sh ; 7. shift right logical (srl): result = in2 >> sh ; 8. shift right arithmetic (sra): result = in2 >>> sh ;

24 24 Exercise 4 Parity Checker Check data integrity by comparing received parity bits with calculated parity values. Employ the reduction XOR operator ^[data] for parity calculation. MIPS ALU Design a limited functionality MIPS ALU module Implement the following Instructions: Signed Add, Add immediate, Sub. Use signed arithmetic. Bitwise Or, Or immediate. Unsigned. Shift left logical, Shift right logical, Shift right arithmetic, Unsigned. Use signed, negative number to demonstrate the difference between arithmetic & logical right shift. Advanced Exercise: MIPS Execution Pipeline Stage.

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

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

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

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

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

Unsigned Binary Integers

Unsigned Binary Integers Unsigned Binary Integers Given an n-bit number x x n 1 n 2 1 0 n 12 xn 22 x12 x02 Range: 0 to +2 n 1 Example 2.4 Signed and Unsigned Numbers 0000 0000 0000 0000 0000 0000 0000 1011 2 = 0 + + 1 2 3 + 0

More information

Unsigned Binary Integers

Unsigned Binary Integers Unsigned Binary Integers Given an n-bit number x x n 1 n 2 1 0 n 12 xn 22 x12 x02 Range: 0 to +2 n 1 Example 2.4 Signed and Unsigned Numbers 0000 0000 0000 0000 0000 0000 0000 1011 2 = 0 + + 1 2 3 + 0

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

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

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

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

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering MIPS Instruction Set James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy MIPS Registers MIPS

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

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

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering MIPS Instruction Set James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy MIPS Registers MIPS

More information

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions Outline EEL-4713 Computer Architecture Multipliers and shifters Multiplication and shift registers Chapter 3, section 3.4 Next lecture Division, floating-point 3.5 3.6 EEL-4713 Ann Gordon-Ross.1 EEL-4713

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

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

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

Lecture Topics. Announcements. Today: The MIPS ISA (P&H ) Next: continued. Milestone #1 (due 1/26) Milestone #2 (due 2/2)

Lecture Topics. Announcements. Today: The MIPS ISA (P&H ) Next: continued. Milestone #1 (due 1/26) Milestone #2 (due 2/2) Lecture Topics Today: The MIPS ISA (P&H 2.1-2.14) Next: continued 1 Announcements Milestone #1 (due 1/26) Milestone #2 (due 2/2) Milestone #3 (due 2/9) 2 1 Evolution of Computing Machinery To understand

More information

JAVA OPERATORS GENERAL

JAVA OPERATORS GENERAL JAVA OPERATORS GENERAL Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

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

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

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators Course Name: Advanced Java Lecture 2 Topics to be covered Variables Operators Variables -Introduction A variables can be considered as a name given to the location in memory where values are stored. One

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

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

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

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

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands Introduction Operators are the symbols which operates on value or a variable. It tells the compiler to perform certain mathematical or logical manipulations. Can be of following categories: Unary requires

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 4: Logic Operations and Introduction to Conditionals Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Previously examined

More information

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support Components of an ISA EE 357 Unit 11 MIPS ISA 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support SUBtract instruc. vs. NEGate + ADD instrucs. 3. Registers accessible

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

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

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

CSCI 402: Computer Architectures

CSCI 402: Computer Architectures CSCI 402: Computer Architectures Instructions: Language of the Computer (2) Fengguang Song Department of Computer & Information Science IUPUI Memory Operands Two tribes: Big Endian: Most-significant byte

More information

ECE 154A Introduction to. Fall 2012

ECE 154A Introduction to. Fall 2012 ECE 154A Introduction to Computer Architecture Fall 2012 Dmitri Strukov Lecture 4: Arithmetic and Data Transfer Instructions Agenda Review of last lecture Logic and shift instructions Load/store instructionsi

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware We will examine two MIPS implementations A simplified

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

Sheet For the following C code: a = b + c; b = a + c; d = a b; Write an equivalent assembly MIPS program. Solution:

Sheet For the following C code: a = b + c; b = a + c; d = a b; Write an equivalent assembly MIPS program. Solution: Sheet 2 1- For the following C code: a = b + c; b = a + c; d = a b; Write an equivalent assembly MIPS program. add a, b, c add b, a, c sub d, a, b # b + c a # a + c b # a - b d 2- What is the corresponding

More information

Operators. Lecture 3 COP 3014 Spring January 16, 2018

Operators. Lecture 3 COP 3014 Spring January 16, 2018 Operators Lecture 3 COP 3014 Spring 2018 January 16, 2018 Operators Special built-in symbols that have functionality, and work on operands operand an input to an operator Arity - how many operands an operator

More information

Chapter 3: Operators, Expressions and Type Conversion

Chapter 3: Operators, Expressions and Type Conversion 101 Chapter 3 Operators, Expressions and Type Conversion Chapter 3: Operators, Expressions and Type Conversion Objectives To use basic arithmetic operators. To use increment and decrement operators. To

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

Xuan Guo. Lecture XIV: Review of Chapter 3 & 4. CSC 3210 Computer Organization and Programming Georgia State University. March 5, 2015.

Xuan Guo. Lecture XIV: Review of Chapter 3 & 4. CSC 3210 Computer Organization and Programming Georgia State University. March 5, 2015. CSC 3210 Computer Organization and Programming Georgia State University March 5, 2015 This lecture Plan for the lecture: Binary Hardware Device Converting from Decimal to other number system Converting

More information

Unit 3. Operators. School of Science and Technology INTRODUCTION

Unit 3. Operators. School of Science and Technology INTRODUCTION INTRODUCTION Operators Unit 3 In the previous units (unit 1 and 2) you have learned about the basics of computer programming, different data types, constants, keywords and basic structure of a C program.

More information

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS The Microprocessor without Interlocked Pipeline Stages

More information

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1 Instructions: MIPS ISA Chapter 2 Instructions: Language of the Computer 1 PH Chapter 2 Pt A Instructions: MIPS ISA Based on Text: Patterson Henessey Publisher: Morgan Kaufmann Edited by Y.K. Malaiya for

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

MIPS Integer ALU Requirements

MIPS Integer ALU Requirements MIPS Integer ALU Requirements Add, AddU, Sub, SubU, AddI, AddIU: 2 s complement adder/sub with overflow detection. And, Or, Andi, Ori, Xor, Xori, Nor: Logical AND, logical OR, XOR, nor. SLTI, SLTIU (set

More information

LECTURE 3 C++ Basics Part 2

LECTURE 3 C++ Basics Part 2 LECTURE 3 C++ Basics Part 2 OVERVIEW Operators Type Conversions OPERATORS Operators are special built-in symbols that have functionality, and work on operands. Operators are actually functions that use

More information

ECOM4311 Digital Systems Design

ECOM4311 Digital Systems Design ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. VHDL : Data Types Cont d 2. VHDL : Operators 3. VHDL : Signal Assignments

More information

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

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog Verilog Radek Pelánek and Šimon Řeřucha Contents 1 Computer Aided Design 2 Basic Syntax 3 Gate Level Modeling 4 Behavioral Modeling Computer Aided Design Hardware Description Languages (HDL) Verilog C

More information

Introduction to Verilog/System Verilog

Introduction to Verilog/System Verilog NTUEE DCLAB Feb. 27, 2018 Introduction to Verilog/System Verilog Presenter: Yao-Pin Wang 王耀斌 Advisor: Prof. Chia-Hsiang Yang 楊家驤 Dept. of Electrical Engineering, NTU National Taiwan University What is

More information

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture EEM 486: Computer Architecture Lecture 2 MIPS Instruction Set Architecture EEM 486 Overview Instruction Representation Big idea: stored program consequences of stored program Instructions as numbers Instruction

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

COMP MIPS instructions 2 Feb. 8, f = g + h i;

COMP MIPS instructions 2 Feb. 8, f = g + h i; Register names (save, temporary, zero) From what I have said up to now, you will have the impression that you are free to use any of the 32 registers ($0,..., $31) in any instruction. This is not so, however.

More information

Reduced Instruction Set Computer (RISC)

Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the ISA. RISC Goals RISC: Simplify ISA Simplify CPU Design Better CPU Performance Motivated by simplifying

More information

Computer Architecture

Computer Architecture CS3350B Computer Architecture Winter 2015 Lecture 4.2: MIPS ISA -- Instruction Representation Marc Moreno Maza www.csd.uwo.ca/courses/cs3350b [Adapted from lectures on Computer Organization and Design,

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

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

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

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology Computer Organization MIPS Architecture Department of Computer Science Missouri University of Science & Technology hurson@mst.edu Computer Organization Note, this unit will be covered in three lectures.

More information

Review of Last lecture. Review ALU Design. Designing a Multiplier Shifter Design Review. Booth s algorithm. Today s Outline

Review of Last lecture. Review ALU Design. Designing a Multiplier Shifter Design Review. Booth s algorithm. Today s Outline Today s Outline San Jose State University EE176-SJSU Computer Architecture and Organization Lecture 5 HDL, ALU, Shifter, Booth Algorithm Multiplier & Divider Instructor: Christopher H. Pham Review of Last

More information

Verilog HDL Introduction

Verilog HDL Introduction EEE3050 Theory on Computer Architectures (Spring 2017) Prof. Jinkyu Jeong Verilog HDL Introduction 2017.05.14 TA 이규선 (GYUSUN LEE) / 안민우 (MINWOO AHN) Modules The Module Concept Basic design unit Modules

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA CISC 662 Graduate Computer Architecture Lecture 4 - ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

Tailoring the 32-Bit ALU to MIPS

Tailoring the 32-Bit ALU to MIPS Tailoring the 32-Bit ALU to MIPS MIPS ALU extensions Overflow detection: Carry into MSB XOR Carry out of MSB Branch instructions Shift instructions Slt instruction Immediate instructions ALU performance

More information

Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control

Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic

More information

CS3350B Computer Architecture MIPS Instruction Representation

CS3350B Computer Architecture MIPS Instruction Representation CS3350B Computer Architecture MIPS Instruction Representation Marc Moreno Maza http://www.csd.uwo.ca/~moreno/cs3350_moreno/index.html Department of Computer Science University of Western Ontario, Canada

More information

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

Verilog HDL:Digital Design and Modeling. Chapter 4. Expressions Chapter 4 Expressions 1 Verilog HDL:Digital Design and Modeling Chapter 4 Expressions Chapter 4 Expressions 2 Page 120 //example of using a parameter module param1 (a, b, cin, sum); parameter width = 8;

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

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

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators Operators Overview Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators Operands and Operators Mathematical or logical relationships

More information

The MIPS Instruction Set Architecture

The MIPS Instruction Set Architecture The MIPS Set Architecture CPS 14 Lecture 5 Today s Lecture Admin HW #1 is due HW #2 assigned Outline Review A specific ISA, we ll use it throughout semester, very similar to the NiosII ISA (we will use

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

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA EE 357 Unit 11 MIPS ISA Components of an ISA 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support SUBtract instruc. vs. NEGate + ADD instrucs. 3. Registers accessible

More information

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Computer Organization and Structure. Bing-Yu Chen National Taiwan University Computer Organization and Structure Bing-Yu Chen National Taiwan University Arithmetic for Computers Addition and Subtraction Gate Logic and K-Map Method Constructing a Basic ALU Arithmetic Logic Unit

More information

Instructions: Language of the Computer

Instructions: Language of the Computer Instructions: Language of the Computer Tuesday 22 September 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary Previous Class

More information

MIPS Instruction Set

MIPS Instruction Set MIPS Instruction Set Prof. James L. Frankel Harvard University Version of 7:12 PM 3-Apr-2018 Copyright 2018, 2017, 2016, 201 James L. Frankel. All rights reserved. CPU Overview CPU is an acronym for Central

More information

RUBY OPERATORS. Ruby Arithmetic Operators: Ruby Comparison Operators:

RUBY OPERATORS. Ruby Arithmetic Operators: Ruby Comparison Operators: http://www.tutorialspoint.com/ruby/ruby_operators.htm RUBY OPERATORS Copyright tutorialspoint.com Ruby supports a rich set of operators, as you'd expect from a modern language. Most operators are actually

More information

Arithmetic and Logical Operations

Arithmetic and Logical Operations Arithmetic and Logical Operations 2 CMPE2c x +y + sum Or in tabular form Binary Addition Carry Out Sum B A Carry In Binary Addition And as a full adder a b co ci sum 4-bit Ripple-Carry adder: Carry values

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 3 - Constants, Variables, Data Types, And Operations Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad Outline C Program Data types Variables

More information

Lecture 6 Decision + Shift + I/O

Lecture 6 Decision + Shift + I/O Lecture 6 Decision + Shift + I/O Instructions so far MIPS C Program add, sub, addi, multi, div lw $t0,12($s0) sw $t0, 12($s0) beq $s0, $s1, L1 bne $s0, $s1, L1 j L1 (unconditional branch) slt reg1,reg2,reg3

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

A flow chart is a graphical or symbolic representation of a process.

A flow chart is a graphical or symbolic representation of a process. Q1. Define Algorithm with example? Answer:- A sequential solution of any program that written in human language, called algorithm. Algorithm is first step of the solution process, after the analysis of

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

ECE 30 Introduction to Computer Engineering

ECE 30 Introduction to Computer Engineering ECE 30 Introduction to Computer Engineering Study Problems, Set #6 Spring 2015 1. With x = 1111 1111 1111 1111 1011 0011 0101 0011 2 and y = 0000 0000 0000 0000 0000 0010 1101 0111 2 representing two s

More information

Two-Level CLA for 4-bit Adder. Two-Level CLA for 4-bit Adder. Two-Level CLA for 16-bit Adder. A Closer Look at CLA Delay

Two-Level CLA for 4-bit Adder. Two-Level CLA for 4-bit Adder. Two-Level CLA for 16-bit Adder. A Closer Look at CLA Delay Two-Level CLA for 4-bit Adder Individual carry equations C 1 = g 0 +p 0, C 2 = g 1 +p 1 C 1,C 3 = g 2 +p 2 C 2, = g 3 +p 3 C 3 Fully expanded (infinite hardware) CLA equations C 1 = g 0 +p 0 C 2 = g 1

More information

Chapter 4. The Processor

Chapter 4. The Processor Chapter 4 The Processor Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware 4.1 Introduction We will examine two MIPS implementations

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization CISC 662 Graduate Computer Architecture Lecture 4 - ISA MIPS ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

Operators. Java operators are classified into three categories:

Operators. Java operators are classified into three categories: Operators Operators are symbols that perform arithmetic and logical operations on operands and provide a meaningful result. Operands are data values (variables or constants) which are involved in operations.

More information

Arithmetic for Computers

Arithmetic for Computers MIPS Arithmetic Instructions Cptr280 Dr Curtis Nelson Arithmetic for Computers Operations on integers Addition and subtraction; Multiplication and division; Dealing with overflow; Signed vs. unsigned numbers.

More information

CSE 378 Midterm 2/12/10 Sample Solution

CSE 378 Midterm 2/12/10 Sample Solution Question 1. (6 points) (a) Rewrite the instruction sub $v0,$t8,$a2 using absolute register numbers instead of symbolic names (i.e., if the instruction contained $at, you would rewrite that as $1.) sub

More information

Introduction to Verilog HDL

Introduction to Verilog HDL Introduction to Verilog HDL Ben Abdallah Abderazek National University of Electro-communications, Tokyo, Graduate School of information Systems May 2004 04/09/08 1 What you will understand after having

More information

CT 229. Java Syntax 26/09/2006 CT229

CT 229. Java Syntax 26/09/2006 CT229 CT 229 Java Syntax 26/09/2006 CT229 Lab Assignments Assignment Due Date: Oct 1 st Before submission make sure that the name of each.java file matches the name given in the assignment sheet!!!! Remember:

More information

Review: MIPS Organization

Review: MIPS Organization 1 MIPS Arithmetic Review: MIPS Organization Processor Memory src1 addr 5 src2 addr 5 dst addr 5 write data Register File registers ($zero - $ra) bits src1 data src2 data read/write addr 1 1100 2 30 words

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

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

!"#$%&&"'(')"*+"%,%-".#"'/"'.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

Reduced Instruction Set Computer (RISC)

Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the machine. Reduced number of cycles needed per instruction.

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

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Basic Operators Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators

More information