Number System



1.     Binary – Base 2; digits -0,1 ; Number (1011.1101)2
2.     Octal – Base 8; digits -0,1,2,3,4,5,6,7 ; Number (1324.7604)8
3.     Decimal – Base 10; digits -0,1,2,3,4,5,6,7,8,9 ; Number 567.12
4.     Hexadecimal - Base 16; digits -0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F ; Number (13F7C5.FEB)16
Binary and Hexadecimal System are used in computer science

Number System Conversion
1.       Binary to decimal

2.       Octal to decimal

3.       Hexadecimal to decimal

4.       Decimal to binary

5.       Decimal to octal



6.       Decimal to hex

7.       Binary to octal and vice versa

8.       Binary to Hex and vice versa



Binary Arithmetic
1.       Addition
2.       Subtraction

3.       Multiplication
4.       Division


Digital System
Digital Systems are used in communication, business transactions, traffic control, medical treatment, industrial and scientific enterprises, weather monitoring, internet and so on…
It is s a system that manipulates discrete elements of information that is represented internally in binary form (0 and 1 called binary digits or bits)
It is less error prone and cheaper.

Complements
Complements are used in digital computers for converting subtraction problem to addition problem.
Types
1.       r’s complement (radix)
2.       (r-1)’s complement (diminished radix)
In binary system we have 2’s and 1’s complement and in decimal system we have 10’s and 9’s complement.

9’s complement subtraction
1.       X – Y = X + 9’s complement (Y)
2.       If there is end carry add it to the result.
3.       If there is no end carry, answer will be -9’s complement(result)
10’s complement subtraction
1.       X – Y = X + 10’s complement (Y)
2.       If there is end carry add discard it.
3.       If there is no end carry, answer will be -10’s complement(result)




1’s complement subtraction
4.       X – Y = X + 1’s complement (Y)
5.       If there is end carry add it to the result.
6.       If there is no end carry, answer will be -1’s complement(result)
2’s complement subtraction
4.       X – Y = X + 2’s complement (Y)
5.       If there is end carry add discard it.
6.       If there is no end carry, answer will be -2’s complement(result)




Representation of Signed Integers
Method I : Signed Magnitude Representation (N BITS)
1 bit is for sign and N-1 bits are for magnitude
Range –(2N-1 – 1) to + (2N-1 – 1)
S=0 ( positive number), S=1 (negative number)
+0 and -0 have different representations but mathematically they are same.
Method II : 1’s complement Representation (N BITS)
+X is same as sign magnitude representation of +X
-X = 1’s complement of (X)
Range –(2N-1 – 1) to + (2N-1 – 1)
+0 and -0 have different representations but mathematically they are same.
Method III : 2’s complement Representation (N BITS)
+X is same as sign magnitude representation of +X
-X = 2’s complement of (X)
Range –(2N-1) to + (2N-1 – 1)
+0 and -0 have the same representation.


Binary Codes
Binary codes are group of bits used to represent alphabets, numbers, symbols, and control characters.
With N bits we can have 2N binary codes.
Types
1.       Decimal codes
2.       Character Codes
3.       Error detecting codes

Decimal Codes
BCD (Binary Coded Decimal)
It is 4 bit code (16 codes) used to represent decimal digits 0,1,2,3,4,5,6,7,8 and 9.
Only 10 codes are used and 6 are unused codes.
It also called weighted code with weights 8-4-2-1.
Excess 3 Code
It is 4 bit code (16 codes) used to represent decimal digits 0,1,2,3,4,5,6,7,8 and 9.
Only 10 codes are used and 6 are unused codes.
It is not weighted code, but self complementing code.
Excess 3 code of (N)=BCD  code of (N) + 3
2421 Code
It is 4 bit code (16 codes) used to represent decimal digits 0,1,2,3,4,5,6,7,8 and 9.
Only 10 codes are used and 6 are unused codes.
It is weighted and self complementing code.
Code of (N) = 1’s complement of code( 9 –N)
84-2-1 Code
It is 4 bit code (16 codes) used to represent decimal digits 0,1,2,3,4,5,6,7,8 and 9.
Only 10 codes are used and 6 are unused codes.
It is weighted and self complementing code.
Code of (N) = 1’s complement of code( 9 –N)


Character Codes
·         ASCII ( American Standard Code for Information Interchange)
·         It is a 7 – bit code but most computer system employ it as 8 bit ( 1 byte) code.
·         It has 128 codes
·         26 uppercase and 26 lowercase alphabets
·         10 decimal digits
·         32 special characters (.,+#%^&*#@!<>? And so on)
·         34 control characters (enter, line feed, horizontal tab, space, backspace and so on)

Other Character Codes
Unicode, EBCDIC, ISCII
Explore about these character codes??????

Error Detecting Code
Parity Code - It is 8th bit added to the 7 bit ASCII character code to indicate its parity either even or odd. In even parity total number of 1’s in data is always even whereas in odd parity total number of 1’s in data is always odd. It is helpful in single bit error detection.
Even Parity Error Detection
In this both sender and receiver must work on even parity.
Sender sends data in even parity.
Receiver accepts data only in even parity.
If data is not in even parity it is rejected.

Odd Parity Error Detection
In this both sender and receiver must work on odd parity.
Sender sends data in odd parity.
Receiver accepts data only in odd parity.
If data is not in odd parity it is rejected.

Gray Codes
It is used to represent the digital data when it is converted from analog data.



Only one bit in the code group changes going from one code to next consecutive code.

Popular posts from this blog