1 2-Hardware Design Basics of Embedded Processors.

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

CS105 Introduction to Computer Concepts GATES and CIRCUITS
컴퓨터구조론 교수 채수환. 교재 Computer Systems Organization & Architecture John D. Carpinelli, 2001, Addison Wesley.
HDL Programming Fundamentals
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 2: Custom single-purpose processors.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 2: Custom single-purpose processors.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 2: Custom single-purpose processors.
The Multicycle Processor II CPSC 321 Andreas Klappenecker.
Chapter 4 Gates and Circuits.
Computer Engineering 222. VLSI Digital System Design Introduction.
Microprocessors & Embedded Systems
Chapter 2: Custom single-purpose processors
Computer ArchitectureFall 2008 © August 20 th, Introduction to Computer Architecture Lecture 2 – Digital Logic Design.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
+ CS 325: CS Hardware and Software Organization and Architecture Exam 1: Study Guide.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Chapter 4 Gates and Circuits.
Electronic Design Automation. Course Outline 1.Digital circuit design flow 2.Verilog Hardware Description Language 3.Logic Synthesis –Multilevel logic.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Microprocessors.
Chapter 3 Digital Logic Structures. 3-2 Transistor: Building Block of Computers Microprocessors contain millions of transistors Intel Pentium 4 (2000):
1 2-Hardware Design Basics of Embedded Processors.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Chapter 4 Gates and Circuits.
Chapter 2: Fundamentals of Digital Electronics Dr Mohamed Menacer Taibah University
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
ECE 2372 Modern Digital System Design
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Logic Design Computer Architecture and Design Lecture 1.
Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Roadmap Problems Algorithms.
Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds.
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
Chap 7. Register Transfers and Datapaths. 7.1 Datapaths and Operations Two types of modules of digital systems –Datapath perform data-processing operations.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
EE 466/586 VLSI Design Partha Pande School of EECS Washington State University
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Basics of Energy & Power Dissipation
Instructor:Po-Yu Kuo 教師:郭柏佑
CBP 2006Comp 4070 Concepts and Philosophy of Computing 1 Wrestling with Complex Stuff. With the Correct Approach, even the smallest guy will succeed!
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Introduction to ASIC flow and Verilog HDL
1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks.
IAY 0600 Digital Systems Design Register Transfer Level Design (GCD example) Lab. 7 Alexander Sudnitson Tallinn University of Technology.
Instructor : Po-Yu Kuo 教師:郭柏佑 Ch. 3 Digital Logic Structures EL 1009 計算機概論 ( 電子一 B) Introduction to Computer Science.
Introduction to Computing Systems and Programming Digital Logic Structures.
Introduction to Verilog
Chapter 3 Digital Logic Structures
Dr. Turki F. Al-Somani VHDL synthesis and simulation.
Digital Logic Structures. Transistor: The Digital Building Block Microprocessors contain LOTS of transistors –Intel Pentium 4 (2000): 48 million –IBM.
Week 1: Introduction and Logic gates IT3002 – Computer Architecture
Logic Simulation 1 Outline –Logic Simulation –Logic Design Description –Logic Models Goal –Understand logic simulation problem –Understand logic models.
Instructor:Po-Yu Kuo 教師:郭柏佑
Discussion 2: More to discuss
Instructor:Po-Yu Kuo 教師:郭柏佑
Chap 7. Register Transfers and Datapaths
Chapter 2: Custom single-purpose processors
Basics of digital systems
Chapter 1: Introduction
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Combinatorial Logic Design Practices
Digital Logic Structures Logic gates & Boolean logic
Instructor:Po-Yu Kuo 教師:郭柏佑
Chapter 2: Custom single-purpose processors
Microprocessors.
Chapter 2: Custom single-purpose processors
Chapter 2: Custom single-purpose processors
Presentation transcript:

1 2-Hardware Design Basics of Embedded Processors

2 Outline Introduction Combinational logic Sequential logic Custom single-purpose processor design RT-level custom single-purpose processor design

3 Introduction Processor  Digital circuit that performs a computation tasks  Controller and datapath  General-purpose: variety of computation tasks  Single-purpose: one particular computation task  Custom single-purpose: non-standard task A custom single-purpose processor may be  Fast, small, low power  But, high NRE, longer time-to-market, less flexible Microcontroller CCD preprocessor Pixel coprocessor A2D D2A JPEG codec DMA controller Memory controllerISA bus interfaceUARTLCD ctrl Display ctrl Multiplier/Accum Digital camera chip lens CCD

4 CMOS transistor on silicon Transistor  The basic electrical component in digital systems  Acts as an on/off switch  Voltage at “gate” controls whether current flows from source to drain  Don’t confuse this “gate” with a logic gate source drain oxide gate IC packageIC channel Silicon substrate gate source drain Conducts if gate=1 1

5 CMOS transistor implementations Complementary Metal Oxide Semiconductor We refer to logic levels  Typically 0 is 0V, 1 is 5V Two basic CMOS types  nMOS conducts if gate=1  pMOS conducts if gate=0  Hence “complementary” Basic gates  Inverter, NAND, NOR x F = x' 1 inverter 0 F = (xy)' x 1 x y y NAND gate 0 1 F = (x+y)' x y x y NOR gate 0 gate source drain nMOS Conducts if gate=1 gate source drain pMOS Conducts if gate=0

6 Basic logic gates F = x y AND F = (x y)’ NAND F = x  y XOR F = x Driver F = x’ Inverter x F F = x + y OR F = (x+y)’ NOR x F x y F F x y x y F x y F x y F F = x y XNOR F y x x 0 y 0 F x 0 y 0 F x 0 y 0 F x 0 y 0 F x 0 y 0 F x 0 y 0 F xF xF

7 Combinational logic design A) Problem description y is 1 if a is to 1, or b and c are 1. z is 1 if b or c is to 1, but not both, or if all are 1. D) Minimized output equations a bc y y = a + bc z z = ab + b’c + bc’ a bc C) Output equations y = a'bc + ab'c' + ab'c + abc' + abc z = a'b'c + a'bc' + ab'c + abc' + abc B) Truth table Inputs abc Outputs yz E) Logic Gates a b c y z

8 Combinational components With enable input e  all O’s are 0 if e=0 With carry-in input Ci  sum = A + B + Ci May have status outputs carry, zero, etc. O = I0 if S=0..00 I1 if S=0..01 … I(m-1) if S=1..11 O0 =1 if I=0..00 O1 =1 if I=0..01 … O(n-1) =1 if I=1..11 sum = A+B (first n bits) carry = (n+1)’th bit of A+B less = 1 if A<B equal =1 if A=B greater=1 if A>B O = A op B op determined by S. n-bit, m x 1 Multiplexor O … S0 S(log m) n n I(m-1) I1I0 … log n x n Decoder … O1O0O(n-1) I0 I(log n -1) … n-bit Adder n A B n sumcarry n-bit Comparator nn AB lessequalgreater n bit, m function ALU n n AB … S0 S(log m) n O

9 Sequential components Q = 0 if clear=1, I if load=1 and clock=1, Q(previous) otherwise. Q = 0 if clear=1, Q(prev)+1 if count=1 and clock=1. clear n-bit Register n n load I Q shift IQ n-bit Shift register n-bit Counter n Q Q = lsb - Content shifted - I stored in msb

10 Sequential logic design A) Problem Description You want to construct a clock divider. Slow down your pre- existing clock so that you output a 1 for every four clock cycles x=0 x=1 x=0 a=1 a=0 B) State DiagramC) Implementation Model Combinational logic State register a x I0 I1 Q1 Q0 D) State Table (Moore-type) Inputs Q1Q0a Outputs I1I x Given this implementation model  Sequential logic design quickly reduces to combinational logic design

11 Sequential logic design (cont.) Q1Q0 I1 I1 = Q1’Q0a + Q1a’ + Q1Q0’ a a 1 10 I0 Q1Q0 I0 = Q0a’ + Q0’a x = Q1Q0 x a Q1Q0 E) Minimized Output EquationsF) Combinational Logic a Q1 Q0 I0 I1 x

12 State Machine design issues Multiple levels to design a custom processor  Structural: Uses basic design techniques Produces detailed gate/flip-flop level representation.  Behavioral (Algorithmic) Uses HDL tools Produces netlists Example: Greatest common divisor (GCD)

13 Greatest common divisor circuit (GCD)  continually subtracting the smaller of the two numbers, A or B, from the largest.  Stop when the smallest =0  file: gcd_test_data.txt  file: gcd_test_data_hex.txt E  State Machine?

14 2- Greatest common divisor circuit (GCD) FSM? Challenges? Ideas?

15 Greatest common divisor circuit (GCD): C code #include main () { int A_in, B_in, A, B, Swap, Y, Y_Ref; FILE *file_pointer; file_pointer = fopen("gcd_test_data.txt", "r"); while (!feof(file_pointer)) { fscanf (file_pointer, "%d %d %d\n", &A_in, &B_in, &Y_Ref); A = A_in; B = B_in; if (A != 0 && B != 0) { while (B != 0) { while (A >= B) { A = A - B; } Swap = A; A = B;B = Swap; } } else A = 0; Y = A; //should be equal to Y_Ref } }

16 Greatest common divisor circuit (GCD): Verilog module module GCD_ALG(A_in,B_in,Y); parameter Width = 8; input [Width-1:0] A_in, B_in; output [Width-1:0] Y; reg [Width-1:0] A, B, Swap, Y; or B) begin begin A = A_in; B = B_in; if (A != 0 && B != 0) while (B != 0) begin while (A >= B) A = A - B; Swap = A; A = B; B = Swap; end else A = 0; Y = A; end endmodule

17 Greatest common divisor circuit (GCD): Verilog module module test_GCD; // Test GCD algorithm parameter GCD_tests = 4; parameter Width = 8; reg [Width-1:0] A_in, B_in, Y_Ref; integer N; integer SimResults; reg [Width-1:0] AB_Y_Ref_Arr[1:GCD_tests*3]; wire [Width-1:0] Y; GCD_ALG U0 (A_in,B_in,Y); initial $monitor (" GCD: A=%d B=%d Y=%d. Y should be %d", A_in, B_in, Y, Y_Ref); initial begin $readmemh("gcd_test_data_hex.txt", AB_Y_Ref_Arr); SimResults = $fopen("gcd_simres.txt"); // Open simulation results file for (N=0; N<GCD_tests; N=N+1) begin A_in = AB_Y_Ref_Arr[(N*3)+1]; B_in = AB_Y_Ref_Arr[(N*3)+2]; Y_Ref =AB_Y_Ref_Arr[(N*3)+3]; #10; $fdisplay (SimResults, " GCD: A=%d B=%d Y=%d. Y should be %d", A_in, B_in, Y, Y_Ref); end $fclose (SimResults); $finish; end endmodule

18 Greatest common divisor circuit (GCD): VHDL module ENTITY GCD IS PORT (A_in,B_in: IN integer range 0 to 15; Y: OUT integer range 0 to 15 ); END GCD; ARCHITECTURE behaviour OF GCD IS BEGIN Process (A_in,B_in) variable A, B, Swap: integer range 0 to 15; BEGIN A := A_in;B := B_in; for i in 0 to 15 loop if (A /= 0 and B /= 0) then if (A>=B) then A := A - B; else Swap:= A; A := B; B := Swap; end if; else A:=0; end if; end loop; Y<=A; END Process; END behaviour;