Presentation is loading. Please wait.

Presentation is loading. Please wait.

Storage of Bits Computers represent information as patterns of bits

Similar presentations


Presentation on theme: "Storage of Bits Computers represent information as patterns of bits"— Presentation transcript:

1

2 Storage of Bits Computers represent information as patterns of bits
A bit (Binary Digit) is one of the two digits 0 or 1 Storing a bit in the machine requires a device that can be in one of two states:On or Off , True or False , 0 or 1

3 GATES AND FLIP-FLOPS There are several gates that perform logical operations The basic gates are: AND OR EXLUSIVE-OR(X-OR) NOT

4 AND Gate Logic Circuit A Y B Truth Table A B Y 0 0 0 0 1 0 1 0 0 1 1 1
Logic Equation Y= A.B

5 OR Gate A Y B Logic Circuit Truth Table A B Y 0 0 0 0 1 1 1 0 1 1 1 1
Logic Equation: Y = A + B

6 Exclusive OR (X-OR) A Y B Logic Circuit Truth Table A B Y 0 0 0 0 1 1
Logic Equation Y = A + B

7 NOT Gate A Y Logic Circuit Truth Table A Y Logic Equation Y= A

8 NAND Gate A B Y

9 NOR Gate A B Y

10 Example(1) Draw the logic circuit and find the truth table for the following logic equation:
X=(A+B)C A B C X A B C X

11 Example(1) Draw the logic circuit and find the truth table for the following logic equation:
1 X=(A+B)C A B C X

12 Example(1) Draw the logic circuit and find the truth table for the following logic equation:
1 X=(A+B)C A B C X

13 A B C X 1 No. of States = 2No. Of Inputs X=(A+B)C A B C X 0 0 0 0
Example(1) Draw the logic circuit and find the truth table for the following logic equation: A B C X 1 No. of States = 2No. Of Inputs X=(A+B)C A B C X

14 FLIP - FLOP A flip-flop is a circuit that has one of two output values; its output remains fixed until a temporary pulse from another circuit causes it to shift to other value The significance of a flip-flop is that it stores the information There are several kinds of flip flops like: J-K flip-flop , S-R flip-flop, D flip-flop , T flip-flop

15 J-K Flip-flop J K Q J-K Flip-flop Logic Circuit CK 1

16 J-K Flip-Flop J-K F-F J K CK Q Truth Table : J K Qn Qn+1 0 0 0 0
J-K F-F J K CK Q J-K Symbol No Change Reset Set Toggle

17 Numbering Systems Decimal System Binary System Octal System
Hexadecimal System Decimal System Consists of 10 digits 0,1,2,3,4,5,6,7,8,9 The base for this system is 10 To analyze any decimal number: 652= 102x x x2 = = 652

18 Binary System Consists of two digits 0 and 1
The base for the binary system is 2 It is the system used to represent information inside the computer system It is important to be familiar with conversion methods between the different numbering systems

19 Binary System Decimal -to- Binary conversion:
To convert (8)10from decimal to binary: (8)10=(1000) LSB MSB

20 Binary System Binary -to- Decimal Conversion:
Convert (1011)2 into decimal number: 23x1 + 22x0 + 21x1 + 20x1= = (13)10

21 Octal System Consists of 8 digits: 0,1,2,3,4,5,6,7
The base for the octal system is 8 It has many applications in information coding systems

22 Octal System Decimal -to- Octal Conversion:
To convert (13)10 into Octal number: (13)10=(15) Octal -to- Decimal Conversion: (15)8= 81x1 + 80x5= = (13)10

23 Hexadecimal System It consists of 16 digits:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F The base for hexadecimal system is 16 It is commonly used to describe all the information in the computer system(the information represented as binary numbers and described by hexadecimal system)

24 Hexadecimal System Decimal -to- Hexadecimal Conversion:
Convert(302)10 into Hexadecimal notation: (302)10=(12E)

25 Hexadecimal System Hexadecimal -to- Decimal Conversion: (A4B)16=
162x x x11= =(2575)10

26 Hexadecimal System Hexadecimal -to- Binary:
Binary -to- Hexadecimal: ( )2=( ? )16 F

27 Fractions Decimal -to-Binary: Result Carry
(3.5)10=11.? x2= = x2-1 (0.6)10= x2= =( ) x2= 0.4x2= 1x2-1+1x2-4+1x2-5= x2= = 0.6x2= Round-off Problem

28 Storing Integers: 1. Excess Notation:
It is easy to distinguish the patterns that represent negative values from those do not. Those that represent negative values have a 0 as their most significant bit, while those do not represent negative values have a 1 as their MSB. The MSB is often called Sign Bit

29 1)Excess Notation: The following is 3-bit , excess-4 notation:
Bit Pattern Value represented

30 2) Two’s Complement Notation
A notation used to represent both positive and negative integers It simplifies the arithmetic operations, such as Addition and Subtraction , and then Multiplication and Division By using this notation, the subtraction operation can be done in similar way the addition performed

31 Two’s Complement: To obtain two’s complement of a decimal number, for example ( 5 ): Get the binary value 101, and to represent that this is a positive number, put a leading 0 as MSB 0101 Get the 1’s complement of the above value by inverting each digit: 0101 1010 Add 1 to the result to get 2’s Complement

32 Two’s Complement: Example 0011 1100 1101 Perform 5 - 3.
Sol. Can be performed as 5 + (-3) using 2’s complement notation: 0101 ’s complement of 3 The result(+2) Dropped

33 3) Floating- Point Notation:
A notation used to represent very large or very small positive and negative numbers Consists of byte. The MSB represents sign bit. 0 for positive and 1 for negative The other bits divided as: Sign Exponent Mantissa Bit

34 Floating-Point Notation:
To convert 3 1/2 into F.P notation: 1) The number is +ve, the sign bit is 0 2) (3 1/2)10 is (11.1)2 , to represent it in F.P the radix should be shift left two places, the value becomes .111(which is the mantissa) and the exponent is 2 3) Convert the exponent into excess-4 form by adding 4 to it (which results 6) and convert it into binary 110 (which is the exponent part) 4) The resulting F.P number is( )

35 Floating-Point Notation:
Convert ( ) from F.P notation into decimal number: 1) Sign bit 1 , the No. is negative 2)The exponent is 011 which is 3 ,subtract 4 from it results (-1). This means the radix should be shift left one place. 3)The mantissa is the radix shifted one place left, the resulted value is (00101) which is 1/8 + 1/32 = 5/32 4)The resulted decimal value is - (5/32)

36 Memory System For purpose of storing data, a computer contains a large collection of circuits, each capable of storing a bit. The computer system contains two main types of memory: Main Memory Secondary Memory(Mass Storage)

37 Main Memory: The storage circuits in a machine’s main memory are arranged in manageable units called cells(or words) , with a typical cell size being 8 bits Every 8 bits are called byte Every 1024 bytes called kilobyte(210 KB), and each 1024 KB is Megabyte … The main memory is divided to: Random Access Memory(RAM) Read Only Memory(ROM)

38 Mass Storage: Secondary storage is a cheap and very large (huge amount) storage area It is a permanent storage Classified into: Tapes Disks Compact Disks (CDs)

39 Communication Errors:
During the data transmission between two points, we may lose data. To resolve such a problem, a variety of error detection and error correction techniques have been developed such as: Parity Bit Cyclic Redundancy Check(CRC) Hamming Distance

40 Parity Bit: It is a bit added as MSB used to detect errors without correcting them. Is based on the principle that if each bit pattern being manipulated has an odd number of 1’s (Odd Parity)and a pattern found with an even number of 1’s (Even Parity) This is achieved by adding an extra bit for parity check. Thus an ASCII of 8 bits becomes 9 bits

41 Parity Bit: To obtain the odd parity for character(A):
1) From ASCII table,the hex code of A is 41, in binary is : 2) Since the number of 1’s in the code is even. The odd parity bit must be 1 to get odd number of 1’s, and the complete code becomes: 3)If an error happened in 3rd bit from right ,the received character becomes: , the number of 1’s is even, so the receiver detect that an error has been occurred

42 Parity Bit: 4) This method is used to detect single error and never correct it 5) It fails to detect the error if it happens in the parity bit itself


Download ppt "Storage of Bits Computers represent information as patterns of bits"

Similar presentations


Ads by Google