Академический Документы
Профессиональный Документы
Культура Документы
BINARY SYSTEMS
Click to edit Master subtitle style CHAPTER 1
7/13/12
TOPICS
DIGITAL SYSTEMS NUMBER SYSTEMS NUMBER BASE CONVERSIONS OCTAL AND HEXADECIMAL NUMBERS COMPLEMENTS SIGNED BINARY NUMBERS
7/13/12
BINARY CODES
DIGITAL SYTEMS
SYSTEM TYPES OF SYSTEMS CLASSIFICATION OF SYSTEMS APPLICATIONS OF DIGITAL SYSTEMS ADVANTAGES OF DIGITAL SYSTEMS DISADVANTAGES OF DIGITAL SYSTEMS DIGITAL COMPUTER 7/13/12
SYSTEM
7/13/12
Classification of Systems
Analog Systems (Continuous)
Physical quantities or signals may vary continuously over a specified range.
Thermometer 7/13/12
Digital Clock
Communicat ion
7/13/12
7/13/12
Business Transaction
Traffic Control
7/13/12
Medicine
7/13/12
7/13/12
Interne
Commerci al
7/13/12
Commerc ial
7/13/12
Commerc ial
7/13/12
7/13/12
Industry
7/13/12
Scientific Enterprises
7/13/12
Militar y
7/13/12
Easier to Design Information storage is easy Accuracy and Precision through out the system Operations can be programmed
7/13/12
Digital Computer
It can follow a sequence of instructions called a program, that operates on given data. Program and data can be varied according to the users needs.
7/13/12
Digital Computer
One important characteristic of digital computer is the ability to manipulate discrete elements of information. Discrete information must contain finite number of elements. Eg: 10 Decimal digits, 26 alphabets, 52 playing cards, 64 chess squares
7/13/12
Digital Computer
The name Digital Computer emerged from an application. Early computers are used for numeric computations in which discrete elements are digits. Physical quantities used to represent discrete information are signals. Some of the signals are voltage and current signals (Implemented by 7/13/12 transistors)
Digital Computer
But signals used in digital systems have 2 discrete values 0 & 1 ( binary) Binary Digit- Bit 0 or 1 Group of bits Binary Codes Hence using various techniques, groups of bits can represent discrete symbols.
These symbols are again used to develop system in digital format. 7/13/12
7/13/12
7/13/12
Switching Circuits
Many of sub systems of digital systems take form of a switching circuit. It consists of one or more inputs and outputs having discrete values.
x x
. .
Switching Circuit
Z Z
. .
xm
7/13/12
Z
m
Eg: Multiplexers, Decoders, Eg: Ring Counter, Encoders, PLDs, PLAs, PALs, Synchronous Counter, CPLDs, FPGAs etc. Ripple Counter
7/13/12
In general, switching devices used in digital systems are generally twostate devices.
7/13/12
Number Systems
7/13/12
7/13/12
Numbers have positional importance 349.2510 9 x 100 = 9 x 1=9 4 x 101 = 4 x 10 = 40 3 x 102 = 3 x 100 = 300 2 x 10-1 = 2/10 5 x 10-2 = 5/100
(11001.11)
( 25.75 )10
7/13/12
= 0
( 231.26)10
7/13/12
( 23A4.EC)
16
= 2 * 16^3 + 3 * 16^2 + A * 16^1 + 4 * 16^0 + E * 16^-1 + C * 16^-2 = 8192 + 768 + 160 + 4 + 0.875 + 0.0468
(9214.9218 )10
7/13/12
7/13/12
7/13/12
= (367.54)
7/13/12
Binary Equivalents 000 001 010 011 100 101 110 111
Binary Arithmetic
Binary Addition
7/13/12
7/13/12
7/13/12
Binary Subtraction
11101 - 10011
0101Difference
7/13/12
01010
Binary Multiplication
1001 *1101 _____ 1001 0000 1001 1001 _________ 1110101
7/13/12 Final Product Partial Products
Multiplicand Multiplier
Binary Division
1101 1001 1110101 1001 --------1011 1001 ----------1001
7/13/12
1001
Complements
7/13/12
Also called (R-1)s complement (R-1)s complement of any number system can be defined as ( R-1 )-N R = Base or Radix of a given number system N = given number n = no. of digits present in the given
7/13/12
R = 10
==> (R-1) = 9
( R-1 )s complement = 9s complement = (10-1) N (R-1)s complement of 546700 is 9s complement of 546700 = (10 -1)= 99999-546700
7/13/12
(546700)
= 453299
R=2
==> (R-1) = 1
( R-1 )s complement = 9s complement = (2-1) N (R-1)s complement of 1011000 is 1s complement of 1011000 =(2-1)= 1111111-1011000
7/13/12
(1011000)
= ( 0100111 )
Radix Complement
Also called Rs complement R s complement of any number system can be defined as [ ( R-1 )-N ]+ 1 R = Base or Radix of a given number system N = given number
7/13/12
R = 10 Rs complement = 9s complement
= 999999-546700 = 453299
R=2
==> Rs complement = 2s
complement
= (2-1) N
Rs complement of 1011000 is 1s complement + 1 (1011000)
7/13/12
= ( 0100111 )
During subtraction of two ndigit unsigned numbers M & N of same base R, there occurs two cases Case (i): M>N Case (ii): M<N This operation can be applied for any number system
7/13/12
M= minuend
= 72532
N = subtrahend = 3250
7/13/12
M= N= +_____
1010100 1000011
N = subtrahend =
-- _________ +_________
-_______ Final Answer = - ( 2s complement of +________ 1101111) - 0010001 = - ( 0010001) 1101111 7/13/12
+ve sign indicates a positive number -ve sign indicates a negative number Digital Circuits can understand only two numbers 0 & 1 Hence to indicate the sign, an additional bit is placed as the most significant bit. 0 represents a +ve number 1 represents a ve number
7/13/12
(01000100)
MSB of this no. is 0 which represents
(+68)10
(11000100)
MSB of this no. is 1 which represents
7/13/12
MSB = 1 -ve number (01100) = Magnitude (12)10 = Answer = Sign & Magnitude = (-12)10
7/13/12
MSB = 0 +ve number (111) = ( 7 )10 Magnitude = Answer = Sign & Magnitude = ( +7 )10
7/13/12
representation
( 0101 )
= (+5)10
representation
( 0101 )
= (+5)10
Signed Decimal Numbers (+7) (+6) (+5) (+4) (+3) (+2) (+1) (+0) (-0) (-1) (-2) (-3) (-4) (-5) (-6) (-7) 7/13/12 (-8)
Signed Magnitude 0111 0110 0101 0100 0011 0010 0001 0000 1000 1001 1010 1011 1100 1101 1110 1111 --
Signed 1s complement 0111 0110 0101 0100 0011 0010 0001 0000 1111 1110 1101 1100 1011 1010 1001 1000 --
Signed 2s complement 0111 0110 0101 0100 0011 0010 0001 0000 -1111 1110 1101 1100 1011 1010 1001 1000
7/13/12
As has been shown, when numbers are treated as signed integers, a carry of 1 from the addition of the most significant bits DOES NOT indicate an overflow, 3 00011 + (-3) +11101 = 0 = 00000, with a carry of 1 For signed integers, overflow occurs when:
Overflow Examples
In a 6-bit register + 17 = 010001 + 16 = +010000 =100001 100001 = - (011110 + 1) = - 011111 = -31 In an 8-bit register - 100 = - (0110 0100) = 1001 1011 +1 = 1001 1100 - 50 = - (0011 0010) = 1100 1101 +1 = 7/13/12
A fixed-length register can only hold a Range of numbers For a 4-bit device, the range of positive integers is 0 - 15 For an 8-bit device the range of positive integers is 0 - 255 When adding positive integers, Overflow occurs when the sum falls outside the range of the register
Overflow Summary
For positive integers, overflow occurs when the carry from addition of the leftmost bits is a 1 For signed integers, overflow occurs when either The addition of two negative numbers gives a positive number, or 7/13/12
Binary Codes
7/13/12
Weighted Codes
BINARY CODES
Most compatible system for a computer or a digital system is binary system Most of the users are accustomed to decimal number system To reduce this gap, decimal numbers are converted to binary, arithmetic calculations are 7/13/12 performed in binary, and then
BINARY CODES
Code is a symbolic representation of an information transform During this process, we need to store decimal numbers in computer for performing conversion But computers accept only digits 0s & 1s So, we must represent these decimal 7/13/12 digits by means of a code consisting
BCD Code
In simplest form of binary code, each decimal digit is represented by its binary equivalent. 854.792
1000 0010
7/13/12
0101
0100
0111
1001
( 1 5 7 )10 = ( 0001 0101 0111 ) BCD representation 12 bits denotes a decimal number Binary value 8 bits denotes binary value itself
7/13/12
BCD Addition
1 8 4 0001 +576 ---------760 1000 0100 01 1 1 01 10 1010 0110 0000
0101
Non-Weighted Codes
7/13/12
Excess-3 code
7/13/12
Gray Codes
The property of this code is that the successive decimal digits differ in exactly one bit.
7/13/12
7/13/12
7/13/12
7/13/12
7/13/12
7/13/12
7/13/12
Register Transfer
7/13/12
7/13/12
Binary Logic
7/13/12