Download presentation
Presentation is loading. Please wait.
Published bySamuel Johnson Modified over 8 years ago
1
Number Systems Part 2
2
Counting in Binary DecimalBinary 00 11 210 311 4100 5101 6110 7111 81000 91001 101010 111011 121100 131101 141110 151111 1610000 When the symbols for the first digit are exhausted, the next- higher digit (to the left) is incremented, and counting starts over at 0.
3
Byte The byte is a unit of digital information in computing and telecommunications. It is an ordered collection of bits, in which each bit denotes the binary value of 1 or 0. A byte is composed of 8 bits.
4
Byte Prefixes When you start talking about lots of bytes, you get into prefixes like kilo, mega and giga, as in kilobyte, megabyte and gigabyte (also shortened to K, M and G, as in Kbytes, Mbytes and Gbytes or KB, MB and GB). The following table shows the binary multipliers:
5
Summary of Conversions DecimalBinaryOctalHexadecimal DecimalRepeatedly Divide By 2 Repeatedly Divide By 8 Repeatedly Divide By 16 BinaryMultiply digits by Powers of 2 Group bits into sets of 3 Group bits into sets of 4 OctalMultiply digits by Powers of 8 Represent digits in groups of 3 bits Convert to Binary, Convert to Hex HexadecimalMultiply digits by Powers of 16 Represent digits in groups of 4 bits Convert to Binary, Convert to Oct
6
Number of Bits and No. of possible values 1286432168421 2727 2626 2525 2424 23232 2121 2020 11111111 Largest Number represented in 8 bits: =128 + 64 + 32+16+8+4+2+1 =255
7
Number of Bits, No. of possible values and Range 11111111 Number of possible values = 2 N Range: 0 to 2 N -1(2 8 =256) = 0 to 255
8
Signed Integer Representation Sign and Magnitude One’s Complement Two’s Complement
9
Sign and Magnitude Requires one bit to represent sign – 0 for positive – 1 for negative In 8 bit allocation you can only use 7 bits to represent absolute value of a number Range: - (2 N -1) to + (2 N -1) = -127 to +127
10
Example Store -258 in a 16 bit memory location using sign-and-magnitude representation Solution: – First change the number to binary 100000010 – Add 6 zeros to make a total of N-1 bits 000000100000010 – Add an extra one on the left to show that the number is negative 1000000100000010
11
Representation of Zero in Sign and Magnitude Representation Issue: Two representations of zero – +0 00000000 – -0 10000000
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.