COMP12111: Fundamentals of Computer Engineering

Similar documents
The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

COMP2611: Computer Organization. Introduction to Digital Logic

1. True/False Questions (10 x 1p each = 10p) (a) I forgot to write down my name and student ID number.

211: Computer Architecture Summer 2016

Combinational vs Sequential

CHAPTER 4: Logic Circuits

AIM: To study and verify the truth table of logic gates

DIGITAL CIRCUIT COMBINATORIAL LOGIC

CHAPTER 4: Logic Circuits

Chapter 3. Boolean Algebra and Digital Logic

1. Convert the decimal number to binary, octal, and hexadecimal.

COE328 Course Outline. Fall 2007

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

EE292: Fundamentals of ECE

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Chapter 4. Logic Design

North Shore Community College

D Latch (Transparent Latch)

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

MODULE 3. Combinational & Sequential logic

Physics 323. Experiment # 10 - Digital Circuits

CPS311 Lecture: Sequential Circuits

Logic Gates, Timers, Flip-Flops & Counters. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

WINTER 15 EXAMINATION Model Answer

Logic. Andrew Mark Allen March 4, 2012

AM AM AM AM PM PM PM

Analogue Versus Digital [5 M]

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 2 Logistics

Last time, we saw how latches can be used as memory in a circuit

Slide Set 7. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Computer Systems Architecture

CS 61C: Great Ideas in Computer Architecture

Electrical and Telecommunications Engineering Technology_TCET3122/TC520. NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Microprocessor Design

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Contents Circuits... 1

BCN1043. By Dr. Mritha Ramalingam. Faculty of Computer Systems & Software Engineering

Chapter. Synchronous Sequential Circuits

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Principles of Computer Architecture. Appendix A: Digital Logic

Chapter 5: Synchronous Sequential Logic

Where Are We Now? e.g., ADD $S0 $S1 $S2?? Computed by digital circuit. CSCI 402: Computer Architectures. Some basics of Logic Design (Appendix B)

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

Logic Devices for Interfacing, The 8085 MPU Lecture 4

St. MARTIN S ENGINEERING COLLEGE

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Introduction to Digital Electronics

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

Digital Networks and Systems Laboratory 2 Basic Digital Building Blocks Time 4 hours

COMP sequential logic 1 Jan. 25, 2016

Chapter 5 Sequential Circuits

6.3 Sequential Circuits (plus a few Combinational)

Multiplexor (aka MUX) An example, yet VERY useful circuit!

CS 110 Computer Architecture. Finite State Machines, Functional Units. Instructor: Sören Schwertfeger.

SEMESTER ONE EXAMINATIONS 2002

MC9211 Computer Organization

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

TIME SCHEDULE. MODULE TOPICS PERIODS 1 Number system & Boolean algebra 17 Test I 1 2 Logic families &Combinational logic

CS6201 UNIT I PART-A. Develop or build the following Boolean function with NAND gate F(x,y,z)=(1,2,3,5,7).

Computer Architecture and Organization

Unit 11. Latches and Flip-Flops

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

Tribhuvan University Institute of Science and Technology Bachelor of Science in Computer Science and Information Technology

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Contents Slide Set 6. Introduction to Chapter 7 of the textbook. Outline of Slide Set 6. An outline of the first part of Chapter 7

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

WELCOME. ECE 2030: Introduction to Computer Engineering* Richard M. Dansereau Copyright by R.M. Dansereau,

More Digital Circuits

Lecture 8: Sequential Logic

Synchronous Sequential Logic

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Sequential logic circuits

WINTER 14 EXAMINATION

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

LATCHES & FLIP-FLOP. Chapter 7

Sequential Circuits: Latches & Flip-Flops

Logic Design II (17.342) Spring Lecture Outline

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

Department of Computer Science and Engineering Question Bank- Even Semester:

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

First Name Last Name November 10, 2009 CS-343 Exam 2

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

FPGA Design. Part I - Hardware Components. Thomas Lenzi

Synchronous Sequential Logic

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

CHAPTER 1 LATCHES & FLIP-FLOPS

REPEAT EXAMINATIONS 2002

Transcription:

COMP2: Fundamentals of Computer Engineering Part I Course Overview & Introduction to Logic Paul Nutter

Introduction What is this course about? Computer hardware design o not electronics nothing nasty like transistors! o from logic gates to computers What should you get from it? An overview of the hardware design process o experience of various levels of design o some of the techniques involved An appreciation of the complexity involved o and how it is managed sensibly A flavour of the subject area Intel Core i7 six-core processor o maybe you will want to learn more maybe not 2

Academic Staff Dr Paul Nutter Email: p.nutter@manchester.ac.uk Office: IT9 Ground floor IT building Dr Ernie Hill Email: ernie.hill@manchester.ac.uk Office: IT8 Ground floor IT building Prof Tom Thomson Email: thomas.thomson@manchester.ac.uk Office: IT2 Ground floor IT building 3

What does it involve? Lectures approx. 22 lectures, two per week, 2pm Tues, 2pm Fri Assessment Laboratory put knowledge into practice Examination test lecture and laboratory material ½ hour exam in January tests both knowledge and application of principles Laboratory and examination both count towards 5% of final mark Laboratories, scheduled weekly, each 2 hours (day/time depends on lab group) Start next week you need to collect a copy of the lab manual from the student support office make sure you prepare beforehand! 4

Recommended Textbooks There are a number of textbooks that cover some of the material covered in this course unit. Recommended: Principles of Computer Hardware Alan Clements, 4 th Edition, Oxford University Press, ISBN 978--9-92733-3. Digital Design with RTL Design, VHDL, and Verilog Frank Vahid, 2 nd Edition, Wiley, ISBN 978--47-538-2. Please note: no single book covers ALL the material covered, so we don t insist that you buy any. There should be copies of both in the JRULM and the School library in the resource centre (Kilburn LF). 5

Course Overview Somewhat bottom up Logic Combinatorial logic Sequential logic Register Transfer Level Design tools and techniques Schematic capture and simulation Verilog HDL Computer subsystems Processors Memories Communication Conventional computers PWN EWH 6

What is in a computer? What does a computer actually do? It manipulates information - data How is information represented? The data is in a binary form, strings of s and s How is the information manipulated? The data is manipulated using transistors tiny switches A collection of transistors forms a logic gate that performs a particular logic function AND, OR etc Collections of logic functions form more complex functions ALU etc Data can be stored to memory where it s value is preserved, and retrieved later What does the information represent? Many things Version 2 COMP2: Logic 7

Introduction to Logic In the first set of lectures we will be looking at Binary logic and the electronic components that allow us to manipulate Binary data. How do we represent signals in a Computer? Boolean logic functions and the rules of Boolean algebra Logic gates how we implement Boolean functions Arithmetic operations how do computers add and subtract numbers? Abstraction and Hierarchy how do we control complex designs? Sequential systems time dependent behaviour in electronic systems and more There is lots information, most of which will be new and at first you may not appreciate it s importance. However, don t worry, the notes are self explanatory and most of the information is not covered in great detail (as it would if you were studying electronics for example). Version 2 COMP2: Logic 8

Digital Signals A signal is a message something which carries information. A digital signal is a signal that at any time can have one of a number of finite possible values, or states usually 2 as opposed to analogue signals that can take an infinite number of possible values. The states of digital signals can be interpreted in a variety of ways: TRUE/FALSE ( T / F ) High/Low / True/False are often used for control applications. s and s are the more common for representing data, especially when several bits are used (binary data example: 8-bit, 32-bit). Computers manipulate information in a digital form using binary signals as a collection of s and s we will look at what binary numbers can represent later. 9

Data Representation Digital computers DO NOT manipulate numbers, they manipulate binary signals (binary digits, bits, s and s) Individual bits (binary digits) can be used to represent Boolean {TRUE, FLASE} conditions. The active state can be chosen arbitrarily (see later) Bits are sometimes grouped together and used to represent other variables such as characters, numbers, instructions For example: The bit pattern (that s 6C7565 in hex) could represent: an ARM instruction LDCVSL P, R6, [R5], #-&4 a decimal number 8963952 a floating point number a string.865x 27 (approximately) Paul It s a question of how you interpret things! we will look more at Boolean representations later

Boolean Functions AND, OR and NOT Boolean algebra uses variables whose values can be only or the digital logic states. The two basic logic functions have binary inputs and binary outputs (i.e. inputs and outputs that are either or ). Name Input/Output Operation Symbol AND 2 inputs output Output is (true) if both input variables are. OR 2 input output Output is (true) is either input variable is + The other essential logic function is the unary operator - NOT True = NOT(False), False = NOT(True), or = NOT(), =NOT()

Truth Tables We represent logical functions using logical truth tables that indicate all the possible states of a logical function. AND Inputs Output Inputs Output OR Inputs Output F F F F T F T F F or (more common) T T T NOT* *(or inversion, complement) Input Output NOT(X) = X It is possible to draw a truth table to define any function. truth tables for functions with n inputs have 2 n entries. 2

NAND, NOR Two more Boolean functions are worthy of their own names NAND : which is AND followed by NOT NOR : which is OR followed by NOT NAND Inputs AND NAND NOR Inputs OR NOR NAND and NOR gates are often used in logic circuit design 3

Exclusive-OR Another useful Boolean logic function is the Exclusive-OR gate (EXOR, XOR) The two-input OR function is true if one or more of its inputs are true the exclusive-or is similar, but it excludes the case when both inputs are true. XOR Inputs XOR the XOR operation is often indicated by the symbol + it may be constructed from other (AND/OR/NOT) functions 4

De Morgan s Theorem De Morgan s theorem (named after Augustus De Morgan 86-87) is used to express the relationship between AND, OR, NAND and NOR In words A+B = A.B A.B = A+B The complement (inversion) of a sum equals the the product of the complements; the complement of a product equals the sum of the complements. No(fish OR chips) =No(fish) AND No(chips) No(fish AND chips) =No(fish) OR No(chips) 5

Other Boolean Functions For n variables there are 2 2n possible Boolean functions... so there are 6 (2 4 ) possible 2-input Boolean functions For two Boolean inputs A and B A B A B A B A.B A.B A.B A.B A+B A+B A+B A+B A=B A B most are of no use. 6

Logic Gates Logic expressions are sometimes expressed algebraically; they may also be expressed schematically as gates that are represented using symbols. AND gate Inputs A B C Output C=A.B signal direction OR gate XOR gate A B C A B C C=A+B C=A + B 7

Logic Gates Inversion is represented by a bubble : NOT gate NAND gate NOR gate A C A B C A B C C=A C=A.B C=A+B As well as inversion at the output (to form the NAND and NOR gates), we can invert inputs: A B C Gates with more inputs are also possible: 3- and 4-input AND gates. C=A+B 8

Multiplexers Another common device is the multiplexer, or mux. The mux is a switching device, that selects binary information from one of its many input lines and directs it to a single output line. The 2: mux has the circuit symbol : d The status of the control input, s determines which of the two inputs is connected to the output. d =d s s = = Thus, the mux acts like an electronic switch that selects which source is connected to the output. A mux can have any number of inputs, but must have enough control inputs to be able to select each input (a 4: mux has 4 inputs and 2 control lines, 32: mux has 32 inputs and 5 control lines). Version 2 COMP2: Logic 9

Data What does it mean? Take a 32-bit word and you can interpret it as you wish (as illustrated previously). However Instructions Integers a common interpretation some interpretations prove more useful than others! usually the only operation preformed is decoding o to work out what it does! o performed by specialised hardware o more later the most common data interpretation bits are interpreted as or s the bits are numbered i, from i= to n- starting at (2 n- 2 n-2 2 2 ) each bit has a significance of 2 i Operations provided usually include: addition, subtraction, multiplication, division, and comparison 2

What is the integer value? A decimal number, such as,529 represents a quantity that is equal to: or mathematically thousand + 5 hundreds + 2 tens + 9 units x + 5 + 2 + 9 = 3 + 5 2 + 2 + 9 so at stage the coefficients take the values -9 which are multiplied by the appropriate power of. The decimal number system has a radix, or base, of, since it uses digits and the coefficients are multiplied by powers of. The binary number system has a base of 2, it has coefficients of and, and these are multiplied by powers of 2. So = 2 7 + 2 6 + 2 5 + 2 4 + 2 3 + 2 2 + 2 + 2 = 28+ 64+ 32+ 6+ 8+ 4+ 2+ = +64++6+8++2+ = 9 Simples 2

Arithmetic Operations Addition Remember addition in decimal 35 5+7=2, which is 2 carry + 77 2 3+7+=, which is carry Binary addition is similar, just remember that each each digit has a value of and, the sum of 2 gives a carry + +=2 sum of carry of ++=2 sum of carry of ++=3 sum of carry of (2+) 22

Arithmetic Operations Subtraction Subtraction is the same as adding a negative number but how do you represent a negative number The most common method of representing negative numbers is 2 s complement : -8 = -7 = -6 = -5 = -4 = -3 = -2 = - = = = 2 = 3 = 4 = 5 = 6 = 7 = Positive numbers remain the same, but the msb is the sign bit, indicates a positive number Numbers represented in this way can be added (ignore any carry which falls off the end) +5 + + -2 +3 23

Application of Logic Gates The basic gates (AND, OR, NOT etc.) can be connected together to create a circuit to perform a particular (arbitrary) logic function A simple example of implementing a logic function: P=A.B+C.D AND A and B AND C and D OR the result A B C D P You will do some more examples in the lab 24

Addition of Binary Numbers using Logic Gates To perform binary addition we need a circuit that can add two binary values and produce a sum value and a carry. Truth Table A B A B S C o A B S A B C o This is a half adder To implement an adder that could add two n-bit numbers, you must also be able to add a carry in also this circuit is called a full adder you will look at this in the lab. Version 2 COMP2: Logic 25

Timing Diagrams Truth tables depict all the possible outcomes of a logic function, but they are static, i.e. they do not demonstrate dynamic (time varying) behaviour. Another method of showing a logic function is to use a timing diagram. For example, the AND gate: A B C! changes in logic level are not instantaneous output calculation takes some time (propagation delay) a timing diagram may help highlight possible hazards Timing diagrams are useful when describing sequential circuits 26

When is a signal Active? Intuitively, one thinks as a as an active or true signal this may not be the case. Consider a signal that indicates a door open condition; the same signal also represents door closed, but at the same time that one interpretation is TRUE the other must be FALSE Door Shut Door Open Door Shut Door Open As an example, a security guard may want to know if a door is opened, whilst a submarine captain wants to know that a door is shut! It is quite common to find some Boolean signals are active in one state whereas others are active in the opposite state. signals where high is interpreted as true are called active high signals - open signals where low is interpreted as true are called active low signals - open data signals, where there is no clear true/false case are neither 27

Abstraction Computers are complex things far too complex to think about all the elements at once! Intel Core i7 six-core processor Abstraction makes it possible to design, build and test complex systems. Input Function Output Any function should be: reasonably sensible simple enough to understand self-contained have defined interfaces Example: Add two numbers 28

Hierarchy Split a complex design into more manageable and reusable chunks! System & Architecture Devices Blocks Subblocks Gates Transistors Physics 29

An example of Hierarchy A general purpose binary adder comprises a number of individual operations. Although it would be possible to build this as a single, monolithic entity this would be difficult. Instead the problem can be broken down hierarchically: The sum of n bit numbers requires n adders to perform each sum Each sum is the sum of 3 bits (A i, B i, and a carry in,c i ) We design the logic to add 3 bits (which can be two 2-bit sums) and replicate over all n bits A i +B i +C i =(A i +B i )+C i It is easiest to: Define, design and test each function once Encapsulate each function in its own symbol Reuse logic as much as is feasible Keeping individual functions small makes them more tractable These principles apply to the design of anything even software! 3

Buses You may have heard of buses in the context of computers, it is a much used word A bus is a collection of signals, grouped together for convenience: address bus, data bus Input Bus Input Bus Output Bus Largely, we will stick to using bus as a designator for a collection of bits that form an individual variable. Thus, a 32-bit computer (such as an ARM) will have a 32-bit adder but normally this will have two input buses. In the lab, you will see these named according to two different conventions: busname<3:> busname[3:] 3

Flip-flops (Latches) The flip-flop is an important component within any computer A flop-flop is a bistable device, i.e. it assumes one of two stable states Activation of input(s) causes the flip-flop to assume one of the two states which it remembers even after the input(s) are deactivated. It remains in this state until driven into another state by suitable activation of one or more inputs. It is a simple one bit memory element. With a memory element we are able to implement sequential logic. Flip-flops come in many varieties: the RS (or sometimes SR) flip-flop, the D-type flip-flop, the J-K flip-flop (we won t look at this) 32

S-R Flip-flop R S R S S set input ( set to ) R reset input ( set to ) S R Note: instructing the flip-flop to set and reset at the same time should be avoided. 33

How? S = (initially reset) R = (initially set) R = S R R = S R S = S = S = (after S = ) R = S R R = (after R = ) R = S R S = S = Version 2 COMP2: Logic 34

D-type Latch (The Transparent Latch) based on the S-R flip-flop an easier-to-use device single data input, D separate control enable, En D En Circuit symbol D En En = Latch is frozen. is constant and independent En = Latch is transparent. =D. The D-type latch is also known as a transparent latch because, when enabled, the value that is input travels straight through to the output. 35

D-type Flip-flop the most common/useful state holding device considerably more complex (internally) than other devices very simple to use Master Slave D D D D En En Clk Master & slave act so that the input, D, is sampled only on active (in this case rising) clock edges Clk D master 36

Reality Intrudes An edge-triggered device samples its input the instant the clock rises (or falls in some cases) Unfortunately all circuits have some delay nothing happens instantaneously An edge-triggered device samples its input during a short interval around the time that the clock rises or falls. The interval is a characteristic of the device and is defined by: the set-up time (T SU ) the hold time (T H ) The data must be stable in this interval if the flip-flop is to function correctly. There is also an associated time the propagation delay (T PD ) which is the time taken for the output to change. Clk D T SU T H T PD In a well-engineering system T PD >T H 37

State A flip-flop is capable of storing state. It is a single bit memory. State allows us to build sequential machines rather than evaluating combinatorially. Example Although (in principle) any problem could be solved combinatorially, sequential algorithms allow problems to be solved practically. Sequential algorithms break problems down in steps evaluated in time. Each step passes information to its successors as the system s state. Small problems are tractable 5 x 3 5 Larger problems can be broken down into a sequence of steps 357 x 243 47 5428 357 274 2985 The state of a system is its total internal memory condition a bit can have one of two states a byte (8 bits) has one of 256 states a 32-bit word can adopt one of 4,294,967,296 states 38

Clocks Most computers are synchronous in that state changes are caused to happen as a result of a system-wide clock The clock is an infinite stream of pulse usually a square wave Period Time Edge-triggered circuits respond to one of the two edges of the clock (rising or falling) The clock ensures that all state changes throughout the system happen simultaneously This allows the logic to be described as independent equations without worrying about timing or what happens while the circuits are switching. 39

Summary We have looked at: Data representation how we use binary to represent information in computers Boolean logic and the rules for manipulating Boolean expressions o Truth tables o DeMorgan s theroem Boolean logic and the rules for manipulating Boolean expressions Gates and schematics for representing digital circuits Number representation in binary and simple mathematical operations o 2 s complement arithmetic The issue of timing signals do not change state instantaneously Abstraction & Hierarchy for simplifying design Sequential systems o The D-type flip-flop Version 2 COMP2: Logic 4