Basics of digital systems

Slides:



Advertisements
Similar presentations
컴퓨터구조론 교수 채수환. 교재 Computer Systems Organization & Architecture John D. Carpinelli, 2001, Addison Wesley.
Advertisements

Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Arithmetic Logic Unit (ALU)
Chapter 7 Henry Hexmoor Registers and RTL
التصميم المنطقي Second Course
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
2-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Fundamentals of Digital.
ENGIN112 L20: Sequential Circuits: Flip flops October 20, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 20 Sequential Circuits: Flip.
11/16/2004EE 42 fall 2004 lecture 331 Lecture #33: Some example circuits Last lecture: –Edge triggers –Registers This lecture: –Example circuits –shift.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
Chapter 7 - Part 2 1 CPEN Digital System Design Chapter 7 – Registers and Register Transfers Part 2 – Counters, Register Cells, Buses, & Serial Operations.
ENGIN112 L26: Shift Registers November 3, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 26 Shift Registers.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
Abdullah Said Alkalbani University of Buraimi
Digital Logic Design.
Computer Architecture and Organization Unit -1. Digital Logic Circuits – Logic Gates – Boolean Algebra – Map Simplification – Combinational Circuits –
Logic Design / Processor and Control Units Tony Diep.
Chapter 6 – Digital Electronics – Part 1 1.D (Data) Flip Flops 2.RS (Set-Reset) Flip Flops 3.T Flip Flops 4.JK Flip Flops 5.JKMS Flip Flops Information.
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Dr. Shi Dept. of Electrical and Computer Engineering.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Copyright © Recap: Combinational Circuits Please.
REGISTER TRANSFER AND MICROOPERATIONS
Sequential Logic Design
Computer Science 210 Computer Organization
Combinational Circuits
Class Exercise 1B.
DIGITAL LOGIC CIRCUITS
REGISTER TRANSFER AND MICROOPERATIONS
Flip-Flops and Related Devices
Computer Architecture & Operations I
Sequential Logic.
Chap 7. Register Transfers and Datapaths
Prof. Hsien-Hsin Sean Lee
SLIDES FOR CHAPTER 12 REGISTERS AND COUNTERS
Morgan Kaufmann Publishers The Processor
KU College of Engineering Elec 204: Digital Systems Design
Overview Introduction Logic Gates Flip Flops Registers Counters
Morgan Kaufmann Publishers
Register Transfer and Microoperations
DIGITAL LOGIC CIRCUITS
Flip Flop.
Computer Science 210 Computer Organization
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Digital System Design Review.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Instructor: Alexander Stoytchev
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Fundamentals of Computer Science Part i2
Computer Science 210 Computer Organization
5. Combinational circuits
CS/COE0447 Computer Organization & Assembly Language
The Digital Logic Level
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Computer Organization
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Registers.
Logic Circuits I Lecture 3.
Overview Last lecture Digital hardware systems Today
Flip-Flops.
CSC3050 – Computer Architecture
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
Digital Circuits and Logic
CHAPTER-3 REGISTER TRANSFER LANGUAGE AND MICROOPERATIONS
Week 11 Flip flop & Latches.
Instruction execution and ALU
Presentation transcript:

Basics of digital systems Notes by Annie Guo

Overview Basics of computing with digital systems Hardware fundamentals Logic gates Functional blocks Processor structures

Logic gates Virtually all problems can be solved by digital circuits and systems The basic elements of digital circuits are logic gates Logic gates ideally have signals of two levels: high and low perform logic functions, such as NOT, AND, OR, NAND, NOR Logic gates can be represented by symbols and their functions can be described using truth tables.

NOT, AND & OR gates NOT AND OR Symbol Truth Table X Z = X X Z = X•Y Y 0 1 1 0 X Y X•Y 0 0 0 0 1 0 1 0 0 1 1 1 X Y X+Y 0 1 1 1 0 1 X Z low high high low X X Y X•Y low low low low high low high low low high high high Z = X•Y Y X Z = X+Y X Y X+Y low low low low high high high low high high high high Y

NAND & NOR gates NAND NOR Symbol Truth Table X Z = X•Y Y X Z = X+Y Y X Y X•Y 0 0 1 0 1 1 1 0 1 1 1 0 X Z = X•Y Y X Y X+Y 0 0 1 0 1 0 1 0 0 1 1 0 X Z = X+Y Y

XOR & XNOR gates XOR XNOR Symbol Truth Table X Z = XY Y X Z = XY Y X Y XY 0 0 0 0 1 1 1 0 1 1 1 0 Y X X Y XY 0 0 1 0 1 0 1 0 0 1 1 1 Z = XY Y We can use logic gates to construct logic functional blocks.

Functional blocks With basic logic gates we can build up different functional blocks such as Adders Multiplexers Decoders Latches Registers Counters We can use logic gates to construct logic functional blocks.

Adders (1/3) One bit adder Truth table Logic function Digital circuit Sum: S = A xor B Carry: C = AB Digital circuit Symbol A B S C 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 S C A B A B 1-bit adder S C

Adders (2/3) One bit adder with carry Called Full Adder Symbol Function Adding three 1-bit numbers Full adder A B Cin S Cout A B Cin S Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1

Adders (3/3) n-bit adder Symbol Function Adding two n-bit numbers A S The result is n-bit sum and 1-bit carry n-bit adder A B S C n

Multiplexer Function: The symbol: A multiplexer selects one input among multiple inputs and passes it to output. The selection is controlled by control signal Sn-1 ~S0 The symbol: D0 D1 Dm-1 m:1 mux OR mux Y Sn-1 S0 …

Example 4:1 multiplexer Function: When S1S0 = 00, Y=D0 mux When S1S0 = 00, Y=D0 When S1S0 = 01, Y=D1 When S1S0 = 10, Y=D2 When S1S0 = 11, Y=D3

MUX example in AVR

Decoder Function: A decoder converses an n-bit input code to an m-bit output code n  m  2n each valid input code word produces a unique output code Typical n-to-2n decoder One line of outputs represents a specified input combination The symbol: A0 A1 An-1 B0 B1 B2n-1 n-to-2n decoder

Example 3-to-8 register file address decoder Function: Address Output B0 B1 B7 A0 A1 A2 3-to-8 decoder Address Output A2 A1 A0 B0 B1 B2 B3 B4 B5 B6 B7 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1

Constructed with functional components Multi-operation unit Perform 1-bit logic operations: AND, OR, XOR, NOT Constructed with functional components

ALU Perform arithmetic and logic operations Symbol: such as addition, subtraction, logic AND, Logic OR Symbol: A, B are operands, S selects one of operations in ALU A B OR ALU R ALU S

Example Operation selection Operation S2 S1 S0 0 0 0 Addition 0 0 1 Subtraction 0 1 0 AND 0 1 1 OR 1 0 0 XOR 1 0 1 NOT 1 1 0 Increment 1 1 1 Transfer

ALU example in AVR

Latches and Flip Flops (1/3) A latch can store one bit information. Can be constructed in many ways. 2-NAND gate latch R=0, reset the latch S=0, set latch S = R = 1, store the data R S Q

Latches and Flip Flops (2/3) Clocked latch uses clock to control the latch operation When Clk=1, S=1, set the latch S=1, reset the latch S=R=0, store data When Clk=0, Data is retained S R Q Clk

Latches and Flip Flops (3/3) Flip Flops use clock edges to trigger the data-store operation. A very commonly used Flip Flop is D FF On the rising edge of clock, the input data D is locked into the D flip flop Timing diagram D Q(n+1) 0 0 1 1 D Q clk Q cp D Q

Registers (1/3) A register is a collection of latches/FFs symbol storing a vector of bit values symbol PC 15 8 7 0 R(H) R(L)

Registers (2/3) 4-bit Parallel In Parallel Out (PIPO) registers. D Q CP I3 Q3 I2 Q2 I1 Q1 I0 Q0 The 4-bit input I3I2I1I0 is “loaded” (copied to the output Q3Q2Q1Q0 of the D FFs) on the rising clock edge, and that output is held until the next clock edge.

Registers (3/3) 4-bit Serial In Parallel Out (PISO) registers. On the clock edge, the output of each flip-flop is passed to the next flip-flop in the chain. The input signal is fed serially (one bit at a time) into the first flip-flop. The flip-flop outputs are available in parallel Q0 Q1 Q2 Q3 Input D Q D Q D Q D Q Clk

Counters (1/2) A counter increases/decrease its value every clock cycle.

Counters (2/2) 4-bit counter with a synchronous load D3 Q3 with a synchronous load an asynchronous clear counts through 0, 1, 2, …, 15, 0 D2 Q2 D1 Q1 D0 Q0 Clock CP LOAD Reset CLEAR

Digital systems A digital system generally includes two parts: Datapath Performing a variety of operations on data from different sources Control unit Controlling the selection of the operation and data

CPU K. Meno, “Logic and Computer Design Fundamentals”

Example of datapath operations K. Meno, “Logic and Computer Design Fundamentals”

Control unit Control signals determine the operation of the datapath Where do the control signals come from? from control unit Control unit takes the instruction from instruction memory, together with the status values from datapath, to generate the control signals

Some practical designs Tri-state buffer Has three output states High level signal (1) passed from the input Low level signal (0) passed from the input High impedance (Hi-Z) Disconnecting the input devices to the output devices Allows multiple logic gates to drive the same output (e.g, bus) EN IN OUT IN OUT X Hi-Z EN 1 1 1 1

Some practical designs Open collector Act like one-way switch When it is “Open”, no controlling operations

Example Open collector interrupt output that asserts low Pullup resistor Chip 1 Chip 2 Micro INT/ Open collector interrupt output that asserts low Another open collector Microprocessor interrupt input that asserts low

For comprehensive coverage of digital systems design, please take COMP3222 Digital Circuits and Systems Offered in S2 each year

Reading material Appendix B in Computer Organization and Design, The hardware/software interface.

Questions Draw the truth table of the following circuit. S Co Ci B A

Questions 2. Draw the timing diagram of circuit 1. Where the 1-bit comparator outputs 1 when inputs A>=B, otherwise 0; D FF is a positive edge-triggered flip flop.

Questions 3. Construct a digital circuit with functional blocks such that the circuit can perform the following multiplications: bx0, bx1, bx2, bx4, where b is a positive number and all numbers including the multiplication results can be represented by 8-bits.