Dr. Nermin Hamza. Agenda Signed Numbers Properties of Switching Algebra.

Slides:



Advertisements
Similar presentations
KFUPM COE 202: Digital Logic Design Number Systems Part 3 Courtesy of Dr. Ahmad Almulhem.
Advertisements

COE 202: Digital Logic Design Combinational Circuits Part 1
Chapter 2 Logic Circuits.
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
CHAPTER 2 Number Systems, Operations, and Codes
Chapter 1 Binary Systems 1-1. Digital Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Digital Fundamentals Floyd Chapter 2 Tenth Edition
CSCE 211: Digital Logic Design
Mantıksal Tasarım – BBM231 M. Önder Efe
CS 105 Digital Logic Design
1.6 Signed Binary Numbers.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Computers Organization & Assembly Language
Digital Systems and Logic Design
Boolean Algebra and Digital Circuits
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
The Digital Codes.
Morgan Kaufmann Publishers
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
1.7 BINARY CODES BCD Code (Binary –Coded Decimal ) BCD Addition
Functions of Combinational Logic
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
1 Binary Codes Digital systems use 2-state devices that understand only 2 binary values (0 and 1). But we communicate using various symbols and methods.
Complements and Codes by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano  Programmable Controllers-Theory and Implementation,
1. Number Systems Chapt. 2 Location in course textbook.
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Signed Binary Numbers Arithmetic Subtraction – In 2’s-complement form: Example: 1.Take the 2’s complement of the subtrahend (including the sign bit) and.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Boolean Algebra – II. Outline  Basic Theorems of Boolean Algebra  Boolean Functions  Complement of Functions  Standard Forms.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
MECH1500 Chapter 3.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
WEEK #11 FUNCTIONS OF COMBINATIONAL LOGIC (PART 4)
Chapter 1: Binary Systems
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Combinational Logic Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Binary Numbers For digital systems, the.
Module –I Codes: Weighted and non-weighted codes
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
Introduction to Digital Electronics Lecture 2: Number Systems.
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Boolean Algebra. BOOLEAN ALGEBRA Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0).
1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2.
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.
CHAPTER 3 Simplification of Boolean Functions
Computer Code.
CS 105 Digital Logic Design
CHAPTER 1 : INTRODUCTION
Basic Digital Logic Systems
Boolean Algebra.
Boolean Algebra.
Digital Electronics & Logic Design
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION Part (a)
Chapter 1 Number System RGGP, Narwana.
COMS 361 Computer Organization
ECE 331 – Digital System Design
Laws & Rules of Boolean Algebra
Presentation transcript:

Dr. Nermin Hamza

Agenda Signed Numbers Properties of Switching Algebra

Signed Numbers + 9 or -9 In binary system : the left most bit in the most significant bit of the number 0 for – 1 for + Example : let 9 = 1001 So and

Code Systems Binary codes Binary coded decimal (BCD) Gray Code ASCII Code Error Detecting Code

BCD BCD: Binary Coded Decimal The one digits takes from 0 to 9 in decimal In BCD, a digit is usually represented by four bits which, in general, represent the decimal digits 0 through 9. Other bit combinations are sometimes used for a sign or for other indications (e.g., error or overflow).

The 8421 BCD Code BCD stands for Binary-Coded Decimal. A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. Example: Decimal number BCD coded number

BCD Decimal  BCD

Example : (185) 10  (??) BCD Solution : ( ) BCD BCD

Convert the BCD coded number into decimal. Solve Decimal Number BCD Coded Number

Convert the decimal number 350 to its BCD equivalent. Decimal Number BCD Coded Number Solve

BCD Addition BCD is a numerical code and can be used in arithmetic operations. Here is how to add two BCD numbers: Add the two BCD numbers, using the rules for basic binary addition. If a 4-bit sum is equal to or less than 9, it is a valid BCD number. If a 4-bit sum > 9, or if a carry out of the 4-bit group is generated it is an invalid result. Add 6 (0110) to a 4-bit sum in order to skip the six the invalid states and return the code to If a carry results when 6 is added, simply add the carry to the next 4-bit group.

BCD BCD addition

BCD What happen if more than 9 ? Because 4 bits up to 15 which is = 6  0110 add 6 and create the second bit significant The solution is 12 which means :

Ahmad Almulhem, KFUPM 2010 BCD Addition

BCD Example : add 8+9 The solution is :

BCD Example : ( )+( )

BCD Solve: The solution :

The Excess-3 Code Add 3 to each digit of decimal and convert to 4-bit binary form A BCD code (not 8421 BCD) Decimal Binary +3 Excess Decimal Sample Problem: Excess

The Gray Code The Gray code’s most important characteristic is that only one digit changes as you increment or decrement the count. The Gray code is commonly associated with input/output devices such as an optical encoder of a shaft’s angular position. The Gray code is NOT a BCD code. Decimal Gray code

The Gray Code The Gray code is unweighted and is not an arithmetic code. There are no specific weights assigned to the bit positions. Important: the Gray code exhibits only a single bit change from one code word to the next in sequence. This property is important in many applications, such as shaft position encoders.

The Gray Code DecimalBinary Gray Code DecimalBinary

The Gray Code Binary-to-Gray code conversion The MSB in the Gray code is the same as corresponding MSB in the binary number. Going from left to right, add each adjacent pair of binary code bits to get the next Gray code bit. Discard carries. ex: convert to Gray code binary Gray

The Gray Code Gray-to-Binary Conversion The MSB in the binary code is the same as the corresponding bit in the Gray code. Add each binary code bit generated to the Gray code bit in the next adjacent position. Discard carries. ex: convert the Gray code word to binary Gray Binary

The ASCII Code ASCII is an acronym for American Standard Code for Information Interchange Represents numbers, letters, punctuation marks and control characters Standard ASCII is a 7-bit code (127 characters) Extended ASCII (IBM ASCII), an 8-bit code, is also very popular Extended ASCII adds graphics and math symbols to code (total of 256 symbols)

ASCII Features 7-bit code 8 th bit is unused (or used for a parity bit) 2 7 = 128 codes Two general types of codes: 95 are “Graphic” codes (displayable on a console) 33 are “Control” codes (control features of the console or communications channel)

ASCII Chart

Most significant bit Least significant bit

e.g., ‘a’ =

95 Graphic codes

33 Control codes

Alphabetic codes

Numeric codes

Punctuation, etc.

“Hello, world” Example ======================== Binary Hexadecimal C 6F 2C C 64 Decimal Hello, worldHello, world ======================== ========================

Error-detection To detect errors in data : an eight bit is sometimes added to the ASCII character to indicate its parity. ASCII A:

Error Detecting Code In data communication, errors may happen One code change into another code How to detect errors? Add an extra bit called a parity bit such that Number of 1’s is even (even parity) or odd (odd parity)

Error Detecting Code ASCII A = ASCII T =

Properties of Switching Algebra Why do we need Algebra: To Describe the relationships between inputs and outputs To Simplify the expressions of complex network (of gates) To Minimize the logic (number of Gates) needed for implementation To enable us to satisfy the constraints of the problem.

Definition for Switching Algebra OR: a + b is 1 Iff either or both a, b are 1 AND: a.b is 1 Iff both a,b are 1 NOT: a’ is 1 Iff a is 0

Definition for Switching Algebra AND / Product XYX.Y OR / Summation XYX+Y NOT XX’

Definition for Switching Algebra Commutative : a+ b = b+ a ab = ba (P1) Associative: a +(b+c) = (a+b) + c a(bc) = (ab)c (P2)

Basic Properties: Identity: a+1= 1a. 1 = a(P3) Null: a + 0 = aa.0 =0(P4) Complement: a + a’ =1 a.a’= 0(P5) Idempotency: a + a = aa.a=a (P6) Involution: (a’)’ = a (P7) Distributive: a(b+c)= ab + ac a + bc=(a+b)(a+c)(P8)

Basic Properties: Adjacency: ab + ab’ = a (a+b)(a+b’) = a (P9) Demorgan : (a+b )’= a’. b’ (ab)’= a’+ b’(P10)

Boolean Functions F= x+yz XYZY.ZX+Y.Z

Boolean Functions Solve : f= A+B’C ABCB’B’CA+B’C

Boolean Functions NOTAND OR

Boolean Functions F= X+Y’Z X Y Z F

Boolean Functions Solve : f= XY’+X’Z X Y Z F

Boolean Functions The function simplification: F= x’y’z+x’y’z+xy’ =x’z(y’+y)+xy’ =x’z + xy’

Boolean Functions Simplify the following function: (x+y)( x+y’) =x.x+x.y’+x.y+y.y’ =x + x.y’+x.y+ 0 =x(1+y’+y) =x

Boolean Functions Simplify the following function: ABCD+A’BD+ABC’D = ABD(C+C’)+A’BD =ABD+A’BD =BD(A+A’) =BD

Boolean Functions Solve: Simplify and represent to truth table and get the gate implementation: X(X’ +Y) The solution : = XX’+XY = 0+XY =XY XYXY X Y F

Boolean Functions Solve (simplify, draw gates and write the truth table): For: 1- xy+x’z+yz 2- (x+y)(x’+z)(y+z) 3-(A+B+C)’

Boolean Functions (A+B+C)’ LET X’= B+C (A+X)’ = A’X’  demorgan’s law So A’(B+C)’ = A’B’C’