0% found this document useful (0 votes)
29 views41 pages

Number System-1

...

Uploaded by

Aila Datanagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views41 pages

Number System-1

...

Uploaded by

Aila Datanagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

NUMBER SYSTEM

ENGR. EMMERSON A. CANUEL, MSME


NUMBER SYSTEM
 A number system defines how a number can be represented
using distinct symbols. A number can be represented differently in
different systems.
 Many number systems were introduced with the passage of time,
like:
•Decimal number system
•Binary number system
•Octal number system
•Hexadecimal number system
BIT
A unit of information expressed as either a 0 or 1 in binary notation.
BYTE
•A group of binary digits or bits (usually eight) operated on as a unit.
•A byte is considered as a unit of memory size.
BASED (RADIX)
•The base is the number of digits used in it.
•The larger the base, the more numerals are required.
Decimal- Base 10
Binary- Base 2
Octal- Base 8
Hexadecimal- Base 16
Decimal Number system
 Uses ten (10) as a base, also called base-10 system.
 •It uses ten digit symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
 •Each number position represents a weighting factor (positional
value system) which is a power of the base ten. (1, 10, 100, 1000,
etc.)
 A decimal number such as 7392 represents a quantity equal to
7thousands plus 3hundred plus 9 tens, plus 2 units. The thousands,
hundreds, etc. are powers of 10 implied by the position of the
coefficients.
 7,392 is equal to:
7 ∗ 103 + 3 ∗ 102 + 9 ∗ 101 + (2 ∗ 100 )
 In general, a number in decimal point is represented by a series of
coefficient as follows:
𝑎5 𝑎4 𝑎3 𝑎2 𝑎1 𝑎0 . 𝑎−1 𝑎−2 𝑎−3
BINARY NUMBER SYSTEM
 The prefix ‘bi’ stands for 2
 The binary number system consists of 2 digits 0 and 1.
 Since this system uses two digits it has a base : 2
 All digital computers use this number system and convert the
data input from the decimal format into its binary equivalent.
 Since computer is made up of electronic components; it can
only two states either on (1) or off (0). So the data given to the
computers are converted into binary form because a computer
understands only binary language.
(11010110)2 = (214)10
(10101010)2 = (170)10
OCTAL NUMBER SYSTEM
 Octal (base 8) was previously a popular choice for representing
digital circuit numbers in a form that is more compact than binary.
 The octal number system consists of 8 digits i.e. 0 to 7 with the base 8.
 1 octal digit is equivalent to 3 bits.

 Examples:
(123)8= (83)10
(143)8= (99)10
(21)8= (17)10
HEXADECIMAL NUMBER SYSTEM
 The prefix ‘hexa’ stands for 6 and the prefix ‘deci’ stands for 10.
 This number system contains 16 systems and therefore has the
base 16.
 It uses the digits (0-9) and (A-F).
 Numbers are 0, 1, 2…8, 9, A, B, C, D, E, F. B is 11, E is 14.
 1 Hex digit is equal to 4 bits.
 Each place value in a hexadecimal number is a power of 16.
 Examples:
(28)16= (40)10
(2F)16= (47)10
CONVERSION OF INTEGER FROM
DECIMAL TO OTHER BASE
 For each digit position
1.Divide decimal number by the base.
2.The remainder is the lowest-order digit
3.Repeat first two steps until no divisor remains.
Example: Integer Quotient Remainder Coefficient
Convert (13) 10 to binary 13/2 6 1 a0 =1
6/2 3 0 a1 =0
3/2 1 1 a1=1
1/2 0 1 a3=1

ANSWER: (13) 10 = (a3a2a1a0) 2 = (1101) 2


Try the convert the following:

 (53)10= _____ 2

 (255) 10= _____ 8

 (2008) 10= _____ 16

 (100) 10= _____ 4

 (1024) 10= _____ 12


CONVERSION OF FRACTION FROM
DECIMAL TO OTHER BASE
For each digit position:
1.Multiply decimal number by the base.
2.The integer is the highest-order digit
3.Repeat first two steps until fraction becomes zero (or repeated /
continuous).
Integer Fraction Coefficient
Example
0.625 x 2 1 0.250 a-1 =1
Convert (0.625) 10 to binary 0.250 x 2 0 0.50 a-2 =0
0.50 x 2 1 0 a-3=1

Answer: (0.625) 10 = (0.a-1a-2a-3) 2 = (0.101) 2


Try to convert the following:

(0.8125)10= ______2

(0.3125)10= ______8
Hexadecimal to Binary Conversion
 Converting from Hex to Binary is easy:

 Every hex digit becomes 4 binary digits

 Example #1: (1AF5)16


=(0001 1010 1111 0101)2

 Example #2: (306.D)16


= ( 0011 0000 0110. 1101 )2
Binary to Hexadecimal Conversion
 Just as simple, reverse to process

Example: (11100101010101.1101)2
=(0011 1001 0101 0101 . 1101)2
=(3955.D)16

Example: (10110001101011.11110010)2
=(10 1100 0110 1011 . 1111 0010) 2
=(2C6B.F2)16
OCTAL TO BINARY CONVERSION
 Converting from Octal to Binary is trivial:
 Every octal digit becomes 3 binary digits

Example: (17.5 )8
=(001 111 . 101)2

Example: (673.124 )8
=(110 111 011 . 001 010 100)2
BINARY TO OCTAL CONVERSION
 Just as simple, reverse to process

Example: (11001010101.011101)2
=(011 001 010 101 . 011 101)2
=(3125.35)8
Example: (10110001101011.111100000110)2
=(10 110 001 101 011 . 111 100 000 110)2
=( 26153.7460)8
Try to convert the following:
BINARY ADDITION
 Binary addition is very simple.
 Same rule as decimal
BINARY SUBTRACTION
 We can perform subtraction (with borrows in place of
carries)
 The subtraction of binary numbers is slightly more
complicated
 The rules are still the same as in decimal, except that the
borrow in a given significant position adds 2 to a
minuend digit.
 Let’s subtract (10111)2 from (1001101)2 …
BINARY MULTIPLICATION
 Much the same as decimal multiplication, except that
the multiplication operations are much simpler…
COMPLEMENTS
 Common use of complement: subtraction operation.

 Perform subtraction through the addition operation.

 Two types of complements for each base-r system:

 r’s complement ( radix complement )

 (r-1)’s complement ( diminished radix complement)


(r-1)’s Complements
 (r-1)’s complement for a number N with n digits in base-r numbering
system is defined as:

(rn -1 ) – N

 Example #1: Find the 9’s complement of 12389:


= (105 -1 ) - 12389
= 99999 -12389
= 87610
 Example #2: Find the 9’s complement of 1234:
= (104 -1) – 1234
= 9999 -1234
= 8765

 Example #3: Find the 1’s complement of 1011001:


= (27 – 1 ) – 101 1001
=127-101 1001
= 111 1111 – 101 1001 = 010 0110

 Notice that the 1’s complement of binary numbers is formed by changing


1’s to 0’s and 0’s to 1’s

 Example: 1’s complement of 0001111 is


1110000.
(r’s complement)
 (r’s) complement for number N in base r with n digits is defined as
rn – N
 Also, r’s complement = ( r-1)’s complement +1

 Example #1: Find the 10’s complement of 2389:


=9999 - 2389
= 7610 + 1
= 7611
 Example #2: Find the 2’s complement of 10 1100:
= 11 1111 - 10 1100
= 01 0011 + 1
= 010100
Signed Binary Numbers
 01001 can be considered unsigned binary = 9 or signed
binary = +9
 But, 11001 can be considered unsigned binary = 25 or signed
binary = -9
 Signed numbers uses 0 for “+” and 1 for “-” , this system is
called Signed-magnitude convention
 All negative numbers have 1 in leftmost bit
 Signed magnitude is mostly used in ordinary arithmetic.
 The 1’s complement is mostly used in logical operations.
 The 2’s complement is mostly used in computer arithmetic.
BINARY CODES FOR DECIMAL DIGIT
Binary Coded Decimal
 Binary Coded Decimal (BCD) represents each decimal digit with
four bits
Ex. 0011 0010 1001 = 32910
 This is NOT the same as 0011001010012
 BCD is not very efficient
 Used in early computers (1940s, 1950s)
 Used to encode numbers for seven-segment displays
Gray Code
 Gray code is not a number system
 It is an alternate way to represent
four bit data
 Only one bit changes from one
decimal digit to the next
 Useful for reducing errors in
communication
 Can be scaled to larger numbers
ASCII Code
 American Standard Code for Information Interchange
 ASCII is a 7-bit code, frequently used with a 8th bit for error
ASCII Codes
 A – Z (26 codes), a – z (26 codes)
 0 – 9 (10 codes), others (@#$%^&*….)
 Transmission susceptible to noise
 Typical transmission rates (1500 Kbps, 56.6 Kbps)
ERROR
 Error is a condition when the output information does not
match with the input information. During transmission,
digital signals suffer from noise that can introduce errors
in the binary bits travelling from one system to other. That
means a 0 bit may change to 1 or a 1 bit may change to
0.
ERROR DETECTION CODE
 To detect the error in data communication, one of the most common
error detection used is parity bit.

 Parity Bit, is an extra bit included with a message to make the total
number of 1’s transmitted either odd or even.

 The bit characters included parity bits (with even or odd parity) are
transmitted to their destination. If the parity of received character is
not even it means at least one bits has been changed.
PARITY BIT
Error-Correcting codes
 Along with error-detecting code, we can also pass some data to figure
out the original message from the corrupt message that we received.
This type of code is called an error-correcting code.

 Error-correcting codes also deploy the same strategy as error-detecting


codes but additionally, such codes also detect the exact location of
the corrupt bit.

 In error-correcting codes, parity check has a simple way to detect


errors along with a sophisticated mechanism to determine the corrupt
bit location. Once the corrupt bit is located, its value is reverted (from 0
to 1 or 1 to 0) to get the original message.
How to Detect and Correct Errors?
 To detect and correct the errors, additional bits are added to
the data bits at the time of transmission.

 The additional bits are called parity bits.

 They allow detection or correction of the errors.

 The data bits along with the parity bits form a code word.
Parity Checking of Error Detection
 It is the simplest technique for detecting and correcting errors. The MSB
of an 8-bits word is used as the parity bit and the remaining 7 bits are
used as data or message bits. The parity of 8-bits transmitted word can
be either even parity or odd parity.

 Even parity -- Even parity means the number of 1's in the given word
including the parity bit should be even (2,4,6,....).
 Odd parity -- Odd parity means the number of 1's in the given word
including the parity bit should be odd (1,3,5,....).
How Does Error Detection Take
Place?
 Parity checking at the receiver can detect the presence of an error
if the parity of the receiver signal is different from the expected
parity. That means, if it is known that the parity of the transmitted
signal is always going to be "even" and if the received signal has an
odd parity, then the receiver can conclude that the received signal
is not correct.
 If an error is detected, then the receiver will ignore the received
byte and request for retransmission of the same byte to the
transmitter.
Register Transfer
 Data can move from a register to a register
 Digital logic used to process data
Transfer of Information

Data input at keyboard


 Shifted into place
Stored in memory
Example of
binary
information
processing

You might also like