B sc cs i bo-de u-i number system
-
Upload
rai-university -
Category
Engineering
-
view
143 -
download
0
Transcript of B sc cs i bo-de u-i number system
![Page 1: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/1.jpg)
Number SystemsCourse: B.Sc.(CS)Sem.: 1 s t Subject : Basics of Digital ElectronicsUnit : 1 s t
![Page 2: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/2.jpg)
An analog system has continuous range of values
A mercury thermometer Vinyl records Human eye A digital system has a set of discrete
values Digital Thermometer Compact Disc (CD) Digital camera
Digital vs. Analog
![Page 3: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/3.jpg)
Benefits of using digital
Image:1
![Page 4: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/4.jpg)
• Discrete elements of information are represented with
bits called binary codes.
Binary System
![Page 5: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/5.jpg)
https://lh3.ggpht.com/nTZ2PAq_p4yIH4-NQrgvUVzizkyFeF8V_zr9K6b2TmkvUl2ruKZJ6TB7Bg3vkFGNhWbang=s122
![Page 6: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/6.jpg)
Review the decimal number system. Base (Radix) is 10 - symbols (0,1, . . 9) Digits For Numbers > 9, add more significant digits in
position to the left, e.g. 19>9. Each position carries a weight.
If we were to write 1936.25 using a power series expansion and base 10 arithmetic:
Decimal Code
![Page 7: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/7.jpg)
Binary number systemThe binary number system.Base is 2 - symbols (0,1) - Binary Digits (Bits)For Numbers > 1, add more significant digits in position to the left, e.g. 10>1.Each position carries a weight (using decimal).
If we write 10111.01 using a decimal power series we convert from binary to decimal:
![Page 8: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/8.jpg)
The octal number system Its base is 8 à eight digits 0, 1, 2, 3, 4, 5, 6,
7
Octal/Hex number systems
The hexadecimal number system– Its base is 16 à first 10 digits are borrowed from the decimal system and the letters A, B, C, D, E, F are used for the digits 10, 11, 12, 13, 14, 15
![Page 9: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/9.jpg)
Conversion from decimal to binary: Let each bit of a binary number be represented
by a variable whose subscript = bit positions, i.e.,
Its decimal equivalent is:
It is necessary to separate the number into an integer part and a fraction: Repeatedly divide the decimal number by 2.
Conversion from Decimal to Binary
![Page 10: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/10.jpg)
Conversion from Decimal to Binary
![Page 11: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/11.jpg)
Conversion from decimal fraction to binary: same method used for integers except
multiplication is used instead of division.
Conversion from Decimal to Binary
![Page 12: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/12.jpg)
Conversion from decimal to octal: The decimal number is first divided by 8.
The remainder is the LSB. The quotient is then divide by 8 and the remainder is the next significant bit and so on.
Convert 1122 to octal.
Conversion from Decimal to Octal
![Page 13: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/13.jpg)
![Page 14: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/14.jpg)
Conversion from and to binary, octal, and hexadecimal plays and important part in digital computers.
Since each octal digit corresponds to 3 binary
digits and each hexa digit corresponds to 4 binary digits.
Conversion using Table
![Page 15: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/15.jpg)
1’s complement of N = ( -1) – N (N is a binary #)
1’s complement can be formed by changing 1’s to 0’s and 0’s to 1’s
2’s complement of a number is obtained by leaving all least significant 0’s and the first 1 unchanged, and replacing 1’s with 0’s and 0’s with 1 in all higher significant digits.
The 1’s complement of 1101011 = 0010100 The 2’s complement of 0110111 = 1001001
1’s and 2’s Complements2n
![Page 16: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/16.jpg)
Subtraction with digital hardware using complements:
Subtraction of two n-digit unsigned numbers M – N
base r: 1. Add M to the r’s complement of N: M + (r– N) 2. If M N, the sum will produce an end carry
and is £ equal to rn that can be discarded. The result is then M – N.
3. If M N, the sum will not produce an end carry
and is equal to rn – (N – M)
Subtraction Using Complements
![Page 17: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/17.jpg)
Binary subtraction is done using the same procedure.
Subtract 1010100 – 1000011 using 2’s complement:
Binary Subtraction using complements
![Page 18: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/18.jpg)
Subtract 1010100 – 1000011 using 1’s complement:
A = 1010100 1’s complement of B =+0111100
Sum = 10010000 End-around carry = + 1
Answer = 0010001
Binary Subtraction using complements
![Page 19: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/19.jpg)
Negative numbers must be initially in 2’s complement form and if the obtained sum is negative, it is in 2’s complement form.
Arithmetic addition
![Page 20: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/20.jpg)
Book References
Digital Logic and Computer Design – M. Morris Mano – Pearson Fundamentals of Digital Circuits – A. Anand Kumar - PHI Digital Electronics - Gothmen - PHI Digital Electronics Principles - Malvino & Leech - MGH
Web References
www.electronics-tutorial.ws www.asic-world.com www.tutorial.points.com
Image references
http://www.youshouldgoaway.com/wp-content/uploads/2014/11/thankyou.jpg
References
![Page 21: B sc cs i bo-de u-i number system](https://reader035.fdocuments.us/reader035/viewer/2022062220/55c42e20bb61eb33478b46b8/html5/thumbnails/21.jpg)