Download presentation
Published byShon Austin Modified over 8 years ago
1
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Logic Design (CE1111) Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
2
Outlines Digital Systems Binary Numbers Number-Base Conversions
Octal and Hexadecimal Numbers Complements of Numbers Signed Binary Numbers Binary Codes Binary Storage and Registers Binary Logic
3
Complements of Numbers
Complements are used in digital computers to simplify the subtraction operation and for logical manipulation Simplifying operations leads to simpler, less expensive circuits to implement the operations
4
Complements of Numbers
Types of complements Radix complement (r’s complement) Diminished radix complement ((r-1)’s complement) Decimal Numbers 10’s complement and 9’s complement Binary Numbers 2’s complement and 1’s complement
5
Complements of Numbers
How can we calculate r’s complement and (r-1)’s complement ? Radix complement 𝑟 𝑛 −𝑁 Diminished radix complement 𝑟 𝑛 −1 −𝑁 Where n is number of digits
6
Complements of Numbers
Calculate the 10’s complement and 9’s complement of Solution 10’s complement: =453300 9’s complement: =453299
7
Complements of Numbers
Calculate the 2’s complement and 1’s complement of Hint Solution 2’s complement: 1’s complement: 2’s complement: leave all least significant 0’s and first 1 unchanged, change from 0 to 1 or from 1 to 0 for all other higher significant digits 1’s complement: change from 0 to 1 or from 1 to 0
8
Signed Binary Numbers Leftmost position of the number used for sign:
Bit Positive number Bit Negative number Example (+9)10 =(01001) signed-magnitude representation (-9)10 =(11001) signed-magnitude representation (-9)10 =(10110) signed-1’s complement representation (-9)10 =(10111) signed-2’s complement representation
10
Arithmetic Addition Unsigned numbers: As ordinary arithmetic Example
25+12=37 13+ −30 =− 30−13 =−17 Signed numbers: Positive numbers as ordinary arithmetic =+37 Negative numbers Write negative number in signed-2’s complement Discard the end carry
11
Arithmetic Addition Example
12
Arithmetic Subtraction
Unsigned numbers: As ordinary arithmetic Example 27−14=13 15− −30 = =45 Signed numbers:
13
Arithmetic Subtraction
Example −6 − −13 =−6+13=+7 −6 10=( )2 =( ) (signed-2’s complement) +13 10=( )2 𝟏 𝟎𝟏𝟏𝟏 =+7 Discard
14
Binary Codes What is a binary code?
An n‐bit binary code is a group of n bits that assumes up to 2 𝑛 distinct combinations of 1’s and 0’s to represent one element that is being coded. Why we use binary codes? Because digital systems understands only 1 or 0
15
Binary Codes What are the most common binary codes?
Binary-Coded Decimal (BCD) 2421-Code Excess-3 Code 8,4,-2,-1 Code Gray Code ASCII Character Code
16
Binary-Coded Decimal Converts Decimal Numbers Binary Numbers How?
Write each decimal digits in 4bits Example
17
Binary-Coded Decimal
18
Signed-BCD Addition Write each decimal number in BCD
Write sign in the leftmost position (0 for +, 1 for -) Add (6) 10=(0110) 2 to the binary sum If 𝑠𝑢𝑚≥ (1010) 2 Example
21
ASCII Character Code It codes 128 Characters in7-bits
26 capital letters 26 small letters 10 decimal digits Special characters ASCII: American Standard Code for Information Interchange
24
Registers What is a register?
A register is a group of binary cells. A register with n cells can store any discrete quantity of information that contains n bits
25
Register Transfer
26
Information Processing
27
Binary Logic What is a binary logic?
Binary logic consists of binary variables and a set of logical operations Variables are designated by letters of the alphabet, such as A, B, C, x, y, z, etc., with each variable having two and only two distinct possible values: 1 and 0
28
Binary Logic What are the most common logic gates? AND: 𝑥.𝑦=𝑥 𝐴𝑁𝐷 𝑦=𝑧
OR: 𝑥+𝑦=𝑥 𝑂𝑅 𝑦=𝑧 NOT: 𝑥 ′ = 𝑥 =𝑧
29
Binary Logic
30
Thank you for your attention
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.