ECEN 301Discussion #21 – Boolean Algebra1 DateDayClass No. TitleChaptersHW Due date Lab Due date Exam 12 NovWed21Boolean Algebra13.2 – 13 EXAM 2 13 NovThu.

Slides:



Advertisements
Similar presentations
Logic Gates.
Advertisements

EET 1131 Unit 7 Arithmetic Operations and Circuits
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
HEXADECIMAL NUMBERS Code
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
ECEN 301Discussion #25 – Final Review1 DateDayClass No. TitleChaptersHW Due date Lab Due date Exam 1 DecMon25Final Review LAB 8 2 DecTue 3 DecWed26Final.
ECEN 301Discussion #22 – Combinational Logic1 DateDayClass No. TitleChaptersHW Due date Lab Due date Exam 17 NovMon22Combinational Logic13.3 – 13.5 LAB.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Assembly Language and Computer Architecture Using C++ and Java
Assembly Language and Computer Architecture Using C++ and Java
Storage of Bits Computers represent information as patterns of bits
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See: P&H Chapter 2.4, 3.2, B.2, B.5, B.6.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Computers Organization & Assembly Language
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
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.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Dale & Lewis Chapter 3 Data Representation. Data and computers Everything inside a computer is stored as patterns of 0s and 1s Numbers, text, audio, video,
Chapter 2 - Data Types. BYU CS/ECEn 124Chapter 2 - Data Types2 Today… Unit 1 slides and homework in JFSB B115 Problems with CCE on Talmage Window’s machines…
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
CSE 241 Computer Organization Lecture # 9 Ch. 4 Computer Arithmetic Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
ECEN 301Discussion #19 – Binary Numbers1 Numbered Moses 1:33,35,37 33 And worlds without number have I created; and I also created them for mine own purpose;
Numbers and Arithmetic Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 8 Dr. Shi Dept. of Electrical and Computer Engineering.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
MicroProcessors Lec. 4 Dr. Tamer Samy Gaafar. Course Web Page —
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
1’S COMPLEMENT REPRESENTATION 1’s complement of a number (binary) is obtained by changing all 1’s to 0 and all 0’s to 1. If one of these numbers is positive.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Logic Gates.
Fundamentals & Ethics of Information Systems IS 201
University of Gujrat Department of Computer Science
Digital Electronics & Logic Design
Logic Gates.
Chapter 8 Computer Arithmetic
ATS’s COLLEGE OF ENGINEERING, MIRAJ Subject:- Basic Electronics Lecturer:- Amit Totade.
Presentation transcript:

ECEN 301Discussion #21 – Boolean Algebra1 DateDayClass No. TitleChaptersHW Due date Lab Due date Exam 12 NovWed21Boolean Algebra13.2 – 13 EXAM 2 13 NovThu 14 NovFriRecitation 15 NovSat 16 NovSun 17 NovMon22Combinational Logic13.3 – 13.5 LAB NovTue 19 NovWed23Sequential Logic14.1 Schedule…

ECEN 301Discussion #21 – Boolean Algebra2 Hardened or Softened by Afflictions Alma 62:41 41 But behold, because of the exceedingly great length of the war between the Nephites and the Lamanites many had become hardened, because of the exceedingly great length of the war; and many were softened because of their afflictions, insomuch that they did humble themselves before God, even in the depth of humility.

ECEN 301Discussion #21 – Boolean Algebra3 Lecture 21 – Binary Numbers & Boolean Algebra

ECEN 301Discussion #21 – Boolean Algebra4 Signed Binary Integers 3 common representations for signed integers: 1.Sign magnitude 2.1’s compliment 3.2’s compliment Most common for computers For all 3 the MSB encodes the sign: 0 = + 1 = 

ECEN 301Discussion #21 – Boolean Algebra5 Sign-Magnitude Range: Representations Ù01111 binary => 15 decimal Ù11111=> -15 Ù00000=> 0 Ù10000=> -0 Problem ÙDifficult addition/subtraction check signs convert to positive use adder or subtractor as required ÙHow to add two sign-magnitude numbers? Ex: 1 + (-4) The MSB encodes the sign: 0 = + 1 = 

ECEN 301Discussion #21 – Boolean Algebra6 1’s Complement Range: Representations Ù00110 binary => 6 decimal Ù11001=> -6 Ù00000=> 0 Ù11111=> -0 Problem ÙDifficult addition/subtraction no need to check signs as before cumbersome logic circuits end-around-carry ÙHow to add to one’s complement numbers? Ex: 4 + (-3) To negate a number, Invert it, bit-by-bit. MSB still encodes the sign: 0 = + 1 = 

ECEN 301Discussion #21 – Boolean Algebra7 Two’s Complement uProblems with sign-magnitude and 1’s complement Ùtwo representations of zero (+0 and –0) Ùarithmetic circuits are complex uTwo’s complement representation developed to make circuits easy for arithmetic. Ùonly one representation for zero Ùjust ADD the two numbers to get the right answer (regardless of sign)

ECEN 301Discussion #21 – Boolean Algebra8 Two’s Complement Range: Representation: ÙIf number is positive or zero, normal binary representation, zeroes in upper bit(s) ÙIf number is negative, start with positive number flip every bit (i.e., take the one’s complement) then add one (5) (9) (1’s comp)(1’s comp) (-5)(-9) MSB still encodes the sign: 0 = + 1 = 

ECEn/CS 124Discussion #2 – Chapter 29 2’s Complement uPositional number representation with a twist ÙMSB has a negative weight 0110 = = = = -2

ECEn/CS 124Discussion #2 – Chapter 210 2’s Complement uPositional number representation with a twist ÙMSB has a negative weight 0110 = = = = -2 –MSB

ECEn/CS 124Discussion #2 – Chapter 211 2’s Complement uPositional number representation with a twist ÙMSB has a negative weight 0110 = = = = -2 –MSB + remaining bits

ECEn/CS 124Discussion #2 – Chapter 212 2’s Complement uPositional number representation with a twist ÙMSB has a negative weight 0110 = = = = -2 –MSB + remaining bits

ECEn/CS 124Discussion #2 – Chapter 213 2’s Complement uPositional number representation with a twist ÙMSB has a negative weight 0110 = = = = -2 –MSB + remaining bits

ECEn/CS 124Discussion #2 – Chapter 214 2’s Complement uPositional number representation with a twist ÙMSB has a negative weight 0110 = = = = -2 –MSB + remaining bits = = –1

ECEN 301Discussion #21 – Boolean Algebra15 Two’s Complement Shortcut uTo take the two’s complement of a number: 1.copy bits from right to left until (and including) the first 1 2.flip remaining bits to the left (1’s comp) (copy)(flip)

ECEN 301Discussion #21 – Boolean Algebra16 Two’s Complement Example3: What is in decimal? What is it’s 2’s complement?

ECEN 301Discussion #21 – Boolean Algebra17 Two’s Complement Example3: What is in decimal? What is it’s 2’s complement? = 0        2 0 = 53 10

ECEN 301Discussion #21 – Boolean Algebra18 Two’s Complement Example3: What is in decimal? What is it’s 2’s complement? = 0        2 0 = (53) (1’s comp) (-53)

ECEN 301Discussion #21 – Boolean Algebra19 Two’s Complement Negation uTo negate a number, invert all the bits and add 1 (or use shortcut) (??)

ECEN 301Discussion #25 – Final Review20 Signed Binary Numbers Binary Sign-magnitude1’s compliment2’s complement

ECEN 301Discussion #21 – Boolean Algebra21 Decimal to Binary Conversion Positive numbers Œ start with empty result  if decimal number is odd, prepend ‘ 1 ’ to result else prepend ‘ 0 ’ Ž divide number by 2, throw away fractional part (INTEGER divide)  if number is non-zero, go back to  else you are done Negative numbers  do above for positive version of number and negate result.

ECEN 301Discussion #21 – Boolean Algebra22 Decimal to Binary Conversion

ECEN 301Discussion #21 – Boolean Algebra23 Hexadecimal Notation uBinary is hard to read and write by hand uHexadecimal is a common alternative  16 digits are ABCDEF = 0x478F = 0xDEAD = 0xBEEF = 0xA5A5 Binary Hex Dec A B C D E F15 0x is a common prefix for writing numbers which means hexadecimal 1.Separate binary code into groups of 4 bits (starting from the right) 2.Translate each group into a single hex digit

ECEN 301Discussion #21 – Boolean Algebra24 Binary to Hex Conversion uEvery four bits is a hex digit. Ùstart grouping from right-hand side D4F8A3 This is not a new machine representation, just a convenient way to write the number.

ECEN 301Discussion #21 – Boolean Algebra25 Boolean Algebra

ECEN 301Discussion #21 – Boolean Algebra26 Boolean Algebra Boolean Algebra: the mathematics associated with binary numbers ÙDeveloped by George Boole in 1854 Variables in boolean algebra can take only one of two possible values: 0 → FALSE 1 → TRUE

ECEN 301Discussion #21 – Boolean Algebra27 Logic Functions 3 different ways to represent logic functions: 1.Equation: a mathematical representation of a logic function Final logic output Each letter variable represents a top-level input to the logic function Mathematical operations (i.e. addition and multiplication) are boolean algebra operations A bar over a variable represent an inverting or a NOT operation

ECEN 301Discussion #21 – Boolean Algebra28 Logic Functions 3 different ways to represent logic functions: 2.Gates: a visual block representation of the function Four 3-input AND gates feeding into one 4-input OR gate Top-level inputs Final output

ECEN 301Discussion #21 – Boolean Algebra29 Logic Functions 3 different ways to represent logic functions: 3.Truth Table: indicates what the output will be for every possible input combination ABCZ If there are n inputs (left-hand columns) there will be 2 n entries (rows) in the table EX: 3 inputs require 2 3 = 8 rows There will always be at least one output (right-hand columns) For each input combination (row) outputs will be either 0 or 1

ECEN 301Discussion #21 – Boolean Algebra30 The Inverter INOUT Truth-table Inverter Symbols Gate Equation IN OUT IN OUT Usually abbreviated with just a ‘bubble’ next to another gate input/output

ECEN 301Discussion #21 – Boolean Algebra31 The AND Gate ABOUT AND Symbol Truth Table Gate Equation NB: multiplication operation → AND A B OUT

ECEN 301Discussion #21 – Boolean Algebra32 The OR Gate OR Symbol Equation Truth Table Gate ABOUT NB: addition operation → OR A B OUT

ECEN 301Discussion #21 – Boolean Algebra33 The NAND Gate ( NOT-AND ) NAND Symbols Equation Truth Table Gate ABOUT A B A B

ECEN 301Discussion #21 – Boolean Algebra34 The NOR Gate ( NOT-OR ) Equation Truth Table Gate ABOUT NOR Symbols A B OUT A B

ECEN 301Discussion #21 – Boolean Algebra35 You should know how to Translate Logic Equations Logic Gates Truth Tables These are three different ways of representing logical information You can convert any one of them to any other ABOUT

ECEN 301Discussion #21 – Boolean Algebra36 Equations to Gates OR

ECEN 301Discussion #21 – Boolean Algebra37 Equations to Gates s a b y y y OR

ECEN 301Discussion #21 – Boolean Algebra38 Gates to Equations out

ECEN 301Discussion #21 – Boolean Algebra39 Gates to Equations out OR

ECEN 301Discussion #21 – Boolean Algebra40 Truth Tables to Gates uEach row of truth table is an AND gate uEach output column is an OR gate SABOUT

ECEN 301Discussion #21 – Boolean Algebra41 Truth Tables to Gates uEach row of truth table is an AND gate uEach output column is an OR gate SABOUT out s a b s a b s a b s a b

ECEN 301Discussion #21 – Boolean Algebra42 Truth Table to Equations uWrite out truth table a combination of AND’s and OR’s Ùequivalent to gates Ùeasily converted to gates SABOUT

ECEN 301Discussion #21 – Boolean Algebra43 Truth Table to Equations uWrite out truth table a combination of AND’s and OR’s Ùequivalent to gates Ùeasily converted to gates SABOUT

ECEN 301Discussion #21 – Boolean Algebra44 Equations to Truth Tables uFor each AND term Ùfill in the proper row on the truth table

ECEN 301Discussion #21 – Boolean Algebra45 Equations to Truth Tables uFor each AND term Ùfill in the proper row on the truth table SABOUT