Lecture 3. Introduction digital logic. Notes. Notes. Notes. Representations. February Bern University of Applied Sciences.

Similar documents
Lecture 6. Notes. Notes. Notes. Representations Z A B and A B R. BTE Electronics Fundamentals August Bern University of Applied Sciences

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So.

Fast Boolean Algebra

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

expression simply by forming an OR of the ANDs of all input variables for which the output is

Lecture 3: Equivalence Relations

Linear Inequalities. Work Sheet 1

set is not closed under matrix [ multiplication, ] and does not form a group.

Infinite Geometric Series

Boolean algebra.

Scientific notation is a way of expressing really big numbers or really small numbers.

EECS 141 Due 04/19/02, 5pm, in 558 Cory

Review of Gaussian Quadrature method

p-adic Egyptian Fractions

UNIT 5 QUADRATIC FUNCTIONS Lesson 3: Creating Quadratic Equations in Two or More Variables Instruction

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

1 2 : 4 5. Why Digital Systems? Lesson 1: Introduction to Digital Logic Design. Numbering systems. Sample Problems 1 5 min. Lesson 1-b: Logic Gates

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

2.4 Linear Inequalities and Interval Notation

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio.

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

Designing Information Devices and Systems I Discussion 8B

Homework 3 Solutions

Multiplying integers EXERCISE 2B INDIVIDUAL PATHWAYS. -6 ì 4 = -6 ì 0 = 4 ì 0 = -6 ì 3 = -5 ì -3 = 4 ì 3 = 4 ì 2 = 4 ì 1 = -5 ì -2 = -6 ì 2 = -6 ì 1 =

Chapter 14. Matrix Representations of Linear Transformations

Boolean Algebra. Boolean Algebra

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Section 6.1 INTRO to LAPLACE TRANSFORMS

Improper Integrals, and Differential Equations

Consolidation Worksheet

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

Lecture 2e Orthogonal Complement (pages )

Analytically, vectors will be represented by lowercase bold-face Latin letters, e.g. a, r, q.

Lesson Notes: Week 40-Vectors

Chapter 1: Fundamentals

AT100 - Introductory Algebra. Section 2.7: Inequalities. x a. x a. x < a

Things to Memorize: A Partial List. January 27, 2017

Overview of Today s Lecture:

Quadratic Forms. Quadratic Forms

fractions Let s Learn to

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

4 7x =250; 5 3x =500; Read section 3.3, 3.4 Announcements: Bell Ringer: Use your calculator to solve

7. Indefinite Integrals

CH 9 INTRO TO EQUATIONS

Convert the NFA into DFA

Chapter 6 Techniques of Integration

4 VECTORS. 4.0 Introduction. Objectives. Activity 1

CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation

Section 4: Integration ECO4112F 2011

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

Read section 3.3, 3.4 Announcements:

CM10196 Topic 4: Functions and Relations

Section 3.1: Exponent Properties

Chapter 1: Logarithmic functions and indices

1 ELEMENTARY ALGEBRA and GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Section 6.1 Definite Integral

ad = cb (1) cf = ed (2) adf = cbf (3) cf b = edb (4)

Parse trees, ambiguity, and Chomsky normal form

Suppose we want to find the area under the parabola and above the x axis, between the lines x = 2 and x = -2.

The Regulated and Riemann Integrals

Introduction to Group Theory

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Lecture 13 - Linking E, ϕ, and ρ

Lesson 25: Adding and Subtracting Rational Expressions

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Bridging the gap: GCSE AS Level

38 Riemann sums and existence of the definite integral.

Torsion in Groups of Integral Triangles

Bases for Vector Spaces

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Chapters Five Notes SN AA U1C5

AQA Further Pure 1. Complex Numbers. Section 1: Introduction to Complex Numbers. The number system

Coalgebra, Lecture 15: Equations for Deterministic Automata

Pre-Session Review. Part 1: Basic Algebra; Linear Functions and Graphs

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

2. VECTORS AND MATRICES IN 3 DIMENSIONS

Calculus Module C21. Areas by Integration. Copyright This publication The Northern Alberta Institute of Technology All Rights Reserved.

1B40 Practical Skills

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24

Designing Information Devices and Systems I Spring 2018 Homework 7

Math 017. Materials With Exercises

QUADRATIC EQUATIONS OBJECTIVE PROBLEMS

CMSC 330: Organization of Programming Languages

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

Introduction To Matrices MCV 4UI Assignment #1

Exploring parametric representation with the TI-84 Plus CE graphing calculator

Riemann Sums and Riemann Integrals

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Riemann Sums and Riemann Integrals

Transcription:

Lecture 3 Ferury 6 ern University of pplied ciences ev. f57fc 3. We hve seen tht circuit cn hve multiple (n) inputs, e.g.,, C, We hve lso seen tht circuit cn hve multiple (m) outputs, e.g. X, Y,, ; or formulted differently, the circuit contins m logic functions Finlly we hve seen how to derive the smllest representtion of those m logic functions The question is now: How do we interpret s designer those inputs nd outputs? Ech of the n inputs nd m outputs represent quntity tht cn e either or ; we cll this it Multiple its cn e grouped together to form one dimensionl rrys; the well known groups re: The ile s group of 4 its, e.g. The yte s group of 8 its ( iles), e.g. ev. f57fc 3. Ordering The groups re nice, ut how do we form ile from the inputs,, C, nd D?. CD?. CD? 3. CD? 4. We need to define n order to e le to uniquely identify the inputs nd outputs Let us define i i [..(n )] s the set of ordered inputs of circuit, e.g. for n=8 the yte formed y the inputs is: 7 6 5 4 3 Let us define O j j [..(m )] s the set of ordered outputs of circuit, e.g. for m=4 the ile formed y the outputs is: O 3 O O O The its nd O re clled the Lest ignificnt its The its n nd O m re clled the Most ignificnt its We lwys write : M L ev. f57fc 3.3

nterprettion O 3 O O 4 Here we hve house with 5 light switches (inputs) nd 3 lmps (outputs). The interprettion of the inputs nd outputs is in this cse the switching of the light sources. This functions cn e s complex s we wnt. There re vrious interprettions of the inputs nd outputs of digitl system, numers re one of them ev. f57fc 3.4 turl umers () For the reminder of the discussion of the numer systems we will use the interprettion of the set of ordered inputs i ; the interprettion of the set of ordered outputs O j is identicl ssuming yte of ordered inputs, thn we could interpret the it ptterns s: 7 6 5 4 3 Deciml 3 4 5 6 7 8 This is the so clled one-hot encoding However these encodings re not very efficient! ev. f57fc 3.5 turl umers () in plce-vlue nottion More compct nd elegnt re the positionl systems like the deciml system we re used to: 3. +. +. 3 3 + + Ech numer consists of i digits The position of the digit denotes its importnce digit d p [..( )] t position p [..(i )] given the se hs the importnce p The numer is therey defined y: i = d p p p= ev. f57fc 3.6

turl umers () in plce-vlue nottion Other plce-vlued numers: The inry numer system: 9 8 7 6 5 4 3 The se =, nd the digit rnge is d p [, ] = + 9 + 6 + 5 + 3 + = 665 The octl numer system: 9 8 7 6 5 4 3 55 o The se = 8, nd the digit rnge is d p [..7] 55 o = 5 8 3 + 8 + 5 8 + 8 = 665 The hexdeciml numer system: 9 8 7 6 5 4 3 x69 The se = 6, nd the digit rnge is d p [..9,,, C, D, E, F] x69 = 6 + 6 6 + 9 6 = 665 ev. f57fc 3.7 turl umers () in plce-vlue nottion How to trnsform 3645 dec to plce-vlue numer with se = 7? 7 7 3 7 7 4 7 4 4 7 5 7 4 4 9 3 8 3 6 4 5 dec = 3 4 5 =7 7 3 6 4 5 5 3 5 4 4 5 5 We strt the division The rest is the digit t position, e.g. 3645 = 5 7 + 5 7 s 5 [..6] we hve to continue the division ow [..6] we re done. Let s check: 3645? = 4 + 9 + 96 + 4 + 5 ev. f57fc 3.8 The ddition How do we dd two plce-vlued numers? Crries: 3 5 9 + 7 5 ssume we wnt to determine = 3 + 59 We strt dding the digits t position p =, e.g. = { d + d = 3 + = 5, the resulting digit d r = <, nd the crry { < c = We continue to position p = ; t ll positions p the sum equls to p = dp + dp + c p, note: c =! Wht hppens if crry c 3 = (for exmple if = + )? ev. f57fc 3.9

The ddition; Limittions of Digitl ystems ssume following inry dder: + We hve circuit tht dds the numers nd n cse = nd = something strnge hppens, s = +! We cll this n overflow sitution n overflow cn occur s ny digitl system hs only limited numer of k-its (k = 3 for this exmple) Given this limittion of k-its, digitl system hs rnge in which it cn represent numers, e.g. for nd k = 3 the representtion rnge is [..( k )] [..7] Q Q Q ev. f57fc 3. The ustrction imilr to the ddition we cn lso sustrct two plce-vlued numers: orrows: 7 5 5 9 3 ssume we wnt to determine = 75 59 We strt t position p =, e.g. = d d = 5 = 3, the resulting digit {d d r = d d d ( + d ) d d < d, nd the orrow { d = d < d We continue to position p = ; t ll positions p the sustrction { equls to p = dp dp p dp dp + p ( + dp ) dp p dp < dp + p ote: =! ev. f57fc 3. The ustrction; o egtive umers ssume following inry sustrctor: Q Q Q We hve circuit tht sustrct the numers nd n cse = nd = something strnge hppens, s =! We cll this n underflow sitution ev. f57fc 3.

ntegers () sign-nd-mgnitude representtion The set of integers contins the turl umers nd their negtives (,,,3,4,...) n the deciml system we use the sign-nd-mgnitude nottion, e.g. +4 nd -4 where the + is often omitted mportnt: the sign-nd-mgnitude nottion hs two s, nmely + D -! n the inry system, we do not hve + nd -, we only hve nd However, y the introduction of the M s sign-it we cn crete inry form of the sign-nd-mgnitude representtion y interpreting =+ nd =-: 3 + x! 3 x! ev. f57fc 3.3 ddition nd ustrction with ntegers () deciml sustrction =- we normlly rewrite to deciml ddition =+C y forming the negte of the sustrctor, e.g. C = -, this cn e esily ccomplished y chnging the sign in sign-nd-mgnitude system. For inry sign-nd-mgnitude interprettion this opertion would e n inversion of the sign-it. n sign-nd-mgnitude representtion we cn write this ddition s: s z = s + s c C 3 = 4 + (+ ) The ddition is complex : s s c Condition: s z Exmples: + + none + + C + = 3 none + C + () = 3 + C + C + () = < C C + () = + C C + = < C + C + = ev. f57fc 3.4 ntegers () one s-complement representtion ddition nd sustrction in the sign-nd-mgnitude representtion requires n dder nd sustrctor, cn t we find nother representtion tht requires less complexity? Wht if insted of inverting only the sign it to represent negtive numer, we invert (one s-complement) ll its: Dec.: nputs: sign-nd-mgnitude: s-complement: +3 + + + 3 OTE: one s-complement representtion lso hs representtions for! ev. f57fc 3.5

ntegers () one s-complement representtion ddition nd sutrcting one s-complement numers is esier thn doing the sme in sign-nd-mgnitude representtion: sustrction =- is gin trnsformed into n ddition =+C y forming the one s-complement C=- (y inverting [complementing] ll the its of ). The ddition =+C cn now e performed y inry ddition s for, with the difference tht crry c k hs to e dded t the L position; this is the so clled end-round crry ddition: + 3 3 + + One scomplement: +3 3 + + + ev. f57fc 3.6 ntegers () one s-complement representtion + 3 3 + + One scomplement: +3 + + + 3 One s-complement is gret, s for oth the ddition nd sustrction of integers we only require inverters nd n end-round crry dder However, n end-round crry dder is slow! Oservtion: The end crry c n is only when one of the vriles or C in =+C is negtive! Why not dd to ll negtive numers? ev. f57fc 3.7 ntegers () two s-complement representtion Two scomplement: One scomplement: The positive numers in two s-complement nottion hve sme it encodings s the other presented numer interprettion systems The + nd - mp on the sme it pttern in the two s-complement nottion resulting in single! The remining it pttern is mpped to -4 +3 + + + 3 +3 + + 3 4 ev. f57fc 3.8

ntegers () one s versus two s complement One s complement ddition/sustrction: +/ O = +/ O O O One s complement is slow due to the end-round crry Two s complement is fster, nd hs only one! ev. f57fc 3.9 ntegers () Excess- representtion The two s complement representtion is commonly used to represent integers in for exmple Processors, Digitl ignl Processors, nd others However, there exists nother importnt representtion: the Excess- representtion, lso clled the ised representtion The Excess- representtion uses pre-specified numer s ising vlue. The deciml numer is represented y ll s Exmple: The three it Excess-3 representtion 4 3 3 The Excess- representtion is minly used in nlog to Digitl converters nd the EEE floting-point stndrd Performing clcultions in the Excess- representtion is only in few cses simple nd out of the scope of this course! ev. f57fc 3. ntegers () Overflow nd Underflow Did we solve the overflow nd underflow prolem? o, s we still hve only k-its to represent numers! We just chnged the rnges: epresenttion: umer: Deciml rnge: inry x x k ign-nd-mgn. x ( k ) x k One s-compl. x ( k ) x k Two s-compl. x ( k ) x k Excess- x x k ( + ) OTE: The two s complement nd excess- representtions hve n symmetric rnge nd do not hve + nd ; they hve single! n cse the deciml clcultion results in vlue x outside the given rnges we phse n overflow or underflow prolem! The detection of overflow nd underflow is outside the scope of this course! ev. f57fc 3.

ummry ( nd ) ll numer representtions re noted s series of its from M...L: For numer representtion of k-its we cn represent the deciml equivlents like: epresenttion: umer: Deciml rnge: inry x x k ign-nd-mgn. x ( k ) x k One s-compl. x ( k ) x k Two s-compl. x ( k ) x k Excess- x x k ( + ) To convert positive (negtive) integer into negtive (positive) one we hve to complement the representtion s: epresenttion: Complement: ign-nd-mgn. nvert sign it One s-compl. nvert ll its Two s-compl. nvert ll its nd dd Excess- lookup in tle ev. f57fc 3. Multipliction ememer: The clssic deciml pen nd pper multipliction: inry multipliction: l l 4 8 3 6 4 4 3 x + + x inry multipliction is performed similr, ut much simpler! s: = nd = (ote: This represent n D gte!) ev. f57fc 3.3 Multipliction 3 3 Hlf dder Hlf dder Hlf dder O = x Overflow O 3 O O O ev. f57fc 3.4

D D D D Division ememer: The clssic deciml pen nd pper division: inry division: l 8 4 4 3 8 3 8 5 4 8 3 6 8 8 8 eminder eminder inry division is performed identicl, ut simpler! s for ech resulting digit we only hve to sustrct once! ev. f57fc 3.5 Division O O O 3 O = % O D = / O 3 O O O 3 O 3 How cn we represent the numer when eminder, e.g. 3 =? ev. f57fc 3.6 Fixed Point representtion () The set on el numers contins ll integers nd ll frctions m n el numers re normlly noted in the deciml system y plcing deciml point: 3.535 We cll this nottion the fixed point representtion of rel numer. ecll: Plce-nd-vlue nottion 3 3. +. +. + 5. + 3. + 5. 3. 5 3 5 3 + + + 5 + 3 + 5 i i Therefore: = d p p ecomes = d p p p= p=j We cn do the sme for ll plce-nd-vlue notted numers of ny se! ev. f57fc 3.7

Floting Point representtion () Wht out very ig nd very smll numers? ig numer like 845949496795.853 we normlly write s.8459 5 or.8459 E5 nd smll numers line. we similrly write s.7545 5 or.7545 E 5 We cll this the floting point representtion, where numer is represented y mntiss nd exponent. The mntiss is in fixed-point representtion, whilst the exponent is in plce-nd-vlue representtion: =.7545 5 mntiss =.7545 where: < mntiss < exponent = 5 where: < exponent < ev. f57fc 3.8 Floting Point representtion () We cn lso represent floting point numers using set of its (EEE 754 stndrd) This is for exmple used in every computer to represent the types flot, doule, etc. For flot often single precision floting point representtion is used: ign it Exponent Excess7. +.577965 x + < Mntiss < Fixed Point ev. f57fc 3.9