DIGITAL Computer Fundamentals & OFFICE AUTOMATION Dr. Felix M Philip Assistant Professor JAIN(DEEMED-TO-BE UNIVERSITY)
Number System A number system is a system of writing for expressing numbers. It is the mathematical notation for representing numbers of a given set by using digits or other symbols in a consistent manner.
Different number systems are Decimal Number System 0 to 9 Binary Number System 0 and 1 Octal Number System 0 to 7 Hexa Decimal Number System 0 to 15 (0-9,A,B,C,D,E,F)
Decimal Number System Uses digits from 0 to 9. Has a base of 10 Value of digit corresponds to its position in the number Example : 495 10 , 84 10
Binary Number System Computer uses the Binary Number System Consists of numbers 0 and 1 Bit ( B inary dig it ) Byte (8 - bits) Example: 1010 2 , 1110 2
Octal Number System Uses the digits from 0 to 7. Has a base of 8 can be represented by a group of 3 bits Example: 123 8 , 435 8
Hexa Decimal Number System Uses the digits from 0 to 15. Numbers from 10 to 15 represented by alphabets A through F Has a base of 16 Can be represented by a group of 4 bits. Example: B3A1 16 , 98C 16
8 Number System Table Decimal Number System Binary Number System Octal Number System Hexa Decimal Number System 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 A B C D E F
9 Conversion of decimal Number to Hexadecimal Number To convert, divide the decimal number by 16 successively Example To convert 540 to decimal 16 540 16 33 -12 2 - 1 The decimal equivalent of 540 10 = 21C 16
10 Conversion from Hexadecimal to Decimal Multiply the digits of the number by the powers of 16 and add Example To convert 21C 16 to its decimal equivalent 2 1 C C X16 = 12 X 1 = 12 1 X16 1 = 1 X 16 = 16 2 X16 2 = 2 X 256= 512 540
11 Conversion of Hexadecimal to Binary Number The binary equivalent of each digit is used Example To convert 5B 16 to binary equivalent: 5 B 01011011 2 To convert B316 to binary equivalent: B 3 10110011 2
12 Conversion of Binary to Decimal Number Sum of product of each digit with 2 raised to the power of positional value Example: To find the decimal equivalent of 1011 2 :
13 Conversion from Octal to Decimal Multiply the digits of the number by the powers of 8 and add Example To convert 215 8 to its decimal equivalent 2 1 5 5 X 8 = 5 X 1 = 5 1 X 8 1 = 1 X 8 = 8 2 X 8 2 = 2 X 64= 128 141
14 9’s Complement Difference of each digit of a number from 9 Example: To find 9’s complement of 54 : 9 9 5 4 4 5
15 10’s Complement Equivalent to the negative of a number Obtained by adding 1 to the 9’s complement of a number Example: To find 10’s complement of 54 = 9’s complement of 54 + 1 = 45 + 1 = 46
16 1’s Complement of binary number Similar to 9’s complement of decimal number Obtained by subtracting each digit from 1 Example To find 1’s complement of 101 1 1 1 1 0 1 0 1 0
17 2’s complement of a binary number Equivalent to 10’s complement of a decimal number Represents the negative equivalent of that number Example To find the 2’s complement of 1010 = 1’s complement of 1010 + 1 = 0101 + 1 = 0110
18 Binary Subtraction To subtract 1010 from 1100 Find 2’s complement of 1010 Number : 1010 1’s complement : 0101 2’s complement : 0110 Add 2’s complement of 1010 with 1100 1100 0110 0010
19 BCD Each digit is represented by four bits Decimal Number BCD 8 00001000 9 00001001 10 00010000 11 00010001 12 00010010 13 00010011 14 00010100 15 00010101 Decimal Number BCD 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111
Gray Code The reflected binary code ( RBC ), also known just as reflected binary ( RB ) or Gray code after Frank Gray, is an ordering of the binary numeral system such that two successive values differ in only one bit (binary digit). The reflected binary code was originally designed to prevent spurious output from electromechanical switches. Today, Gray codes are widely used to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems.
21 Gray Code Only one bit changes for each consecutive numbers Decimal Number Gray Code 8 1100 9 1101 10 1111 11 1110 12 1010 13 1011 14 1001 15 1000 Decimal Number Gray Code 0000 1 0001 2 0011 3 0010 4 0110 5 0111 6 0101 7 0100
Excess- 3 code Excess-3 codes are unweighted and can be obtained by adding 3 to each decimal digit then it can be represented by using 4 bit binary number for each digit. An Excess-3 equivalent of a given binary binary number is obtained using the following steps: Find the decimal equivalent of the given binary number. Add +3 to each digit of decimal number. Convert the newly obtained decimal number back to binary number to get required excess-3 equivalent. You can add 0011 to each four-bit group in binary coded decimal number (BCD) to get desired excess-3 equivalent.
24 ASCII Codes American Standard Code for Information Interchange 7 bit code Represents upto 128 characters First 3 bits-zone bits Second 4 bits-numeric bits
ASCII TABLE
Extended Binary Coded Decimal Interchange Code (EBCDIC) Extended binary coded decimal interchange code (EBCDIC) is an 8-bit binary code for numeric and alphanumeric characters. It was developed and used by IBM. It is a coding representation in which symbols, letters and numbers are presented in binary language.
Fixed-Point Representation This representation has fixed number of bits for integer part and for fractional part. Assume number is using 32-bit format which reserve 1 bit for the sign, 15 bits for the integer part and 16 bits for the fractional part.
Floating-Point Representation The floating number representation of a number has two part: the first part represents a signed fixed point number called mantissa. The second part of designates the position of the decimal (or binary) point and is called the exponent.
Suppose number is using 32-bit format: the 1 bit sign bit, 8 bits for signed exponent, and 23 bits for the fractional part. -53.5=(-110101.1) 2 =(-1.101011)x2 5