






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Introduction Concept and reasons of data representation Data and instructions cannot be entered and processed directly into computers using human language. Any type of data entered must first be converted into machine readable form (Binary form). Computers together with its peripheral devices handle data in its electronic circuits, magnetic media and in optical devices. Data representation on electronic circuits Electronic components such as microprocessors are made up of millions of electronic circuits. Availability of high voltage (ON) in this circuit is interpreted as “1” while the absence of a magnetic field is interpreted as a “0” Data representation in a magnetic media The presences of a magnetic field in one direction on magnetic media is interpreted as “1” while the absence of a magnetic field is interpreted as a “0” Data interpretation on optical media In optical devices, the presence of light is interpreted as “1” while the absence of a light is interpreted as a “0” Definition of terms i. Bit This is a binary digit which can either be 0 or 1. It's the basic unit of data or information in digital computers ii. Byte A group eight bits it's the basic unit for measuring memory size in a computer iii. Nibble It’s half a byte which is usually a group of 4 bits iv. Word It consist of two or more bytes and the largest amount of memory that the computer can handle v. Word length It's the number of bits in each word of a computer e.g. 16 bits, 32 bits, 64 bits etc. A periodic wave can be described using the following parameters i. Amplitude (A) Maximum value a wave can attain ii. Frequency (f) Number of cycles made by a wave in one second and its measured in hertz (Hz). One Hz is equivalent to 1 cycle / second iii. Periodic time (T) Time taken to complete one cycle and it’s given by the formulae T=l/f where f is the frequency of the wave Note: Process of converting digital signal to analogue signals using a modem is known as
Types of data representation Number system and their representation of integer's values i. Decimals The term decimal is derived from a Latin prefix deci which mean ten. This number system has ten digits ranging from 0-9. Decimal numbers should be written with a subscript 10 e.g. 156 10. This is usually ignored in written work. But when many number systems are put together the subscript must always be put. The magnitude of a number can be considered using three parameters Absolute value A number like 256 10 , the absolute value for 6 in the number line will be: Position / place value Refer to the position of the digit in that number whether ones, tens, hundreds etc. A number like 2568 10 can be represented as follows Table 1: position value interpretation THOUSANDS 10^3
Base value / radix This is determined by the number system being used e.g. 156 10 , 16 2 ii. Binary This number system uses two digits 1 and 0 to represent numbers. The place value of the digits of a base two number is influenced by two (the base / radix) e.g. the place values of the 1010 2 are illustrated below Table 2: Binary place / position value interpretation PLACE VALUE (2^0 )
Binary digit 1 0 1 0 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 Fig 1: Absolute value
Base Conversion from one number system to another
1. Converting binary numbers to decimal numbers (Base 2 to Base 10) Steps i. Write the place value starting from the right hand side ii. Write each digit under its place value iii. Multiply each digit by its corresponding place value iv. Add up the product. The answer will be the decimal number in base 10 Table 7: converting 1010 2 (binary) to decimal (base 10) PLACE VALUE 2^3 2^2 2^1 2^0 Binary number 1 0 1 0 Product =(Place value multiplied by binary number) 2^3 x1 2^2 x0 2^1 x1 2^0 x 8x1 4x0 2x1 1x 8 0 2 0 Sum 8+0+2+ Answer Therefore 1010 2 = 10 10 Working with binary fractions Table 8: convert 11.10 2 (binary) to decimal (base 10) PLACE VALUE 2^1 2^0 2 -1^ 2 - Binary number 1 1 ●^1 Product =(Place value multiplied by binary number) 2^1 x1 2^0 x0 ●^2 -1^ x1 2 -2^ x 2x1 1x1 ●^ 0.5x1 0.25x 2 1 ●^ 0.5 0 Sum 2+1+0.5+ Answer **Therefore 11.10 2 = 3.5 10
Converting decimal numbers to binary numbers (Base 10 to Base 2) Method 2 The number in the base of 10 is repeatedly divided by 2 at each level of the division the remainder that is either a l or a 0 is written to the right of the quotient. The remainders are then copied from bottom upwards to give the binary equivalent of the decimal number i.e. 10100000 Table 10: Using the long division method convert 160 10 into binary 2 160 REM 2 2 2 2 2 2 2 80 40 20 10 5 2 1 0
NB: Since dividing the last quotient i.e. 1 divided by 2 does not give a whole number we place it as a remainder Therefore 160 10 = 10100000 2 Converting decimal fractions to binary Convert 45.375 10 to binary Table 11: Converting fraction decimal numbers to binary 2 45 REM 2 2 2 2 2
Therefore 45 10 = 101101 2 The fraction part is dealt with separately as shown below 0.375 10 0.375 x 2 = 0.750 Copy the whole unit down wards 0.750 x 2 = 1. 1.500 x 2 = 1.000 (The fraction has become a zero) Therefore 0.375 10 = 0.011 2 Finally 45.375 10 =101101.011 2 Assignment: Read more on this conversion
OCTAL DIGIT 1 5 4 3 Binary equivalent 001 010 011 100 Therefore 15438 = 001010011100 2
6. Convert hexadecimal to decimal Steps i. First write the place value starting from the right hand side ii. If a digit is a letter such as I A' write its decimal equivalent iii. Multiply each hexadecimal digit with its corresponding place value and then add the product Table 15: Convert 1DC1 16 to decimal (base 10) PLACE VALUE 16^3 16^2 16^1 16^0 Binary number 1 D C 1 Product =(Place value multiplied by binary number) 16^3 x1 16^2 xD 16^1 xC 16^0 x 4096x1 256x13 16x12 1x 4096 3328 192 1 Sum 4096+03328+192+ Answer **Therefore 1DC1 16 = 7617 10
LSB
MSB The fraction part is dealt with separately as shown below 0 .125 10 x 16 =2.00 (The fraction has become zero) Therefore 69110 = 2B3 16 Symbolic representation i. Binary coded decimal code (BCD) ii. Extended Binary coded decimal code interchange code (EBCDIC) iii. American standard code for information interchange code (ASCII) Binary arithmetic operations ALU perform subtraction-using complementation. For multiplication and division the ALU uses a method called shifting before adding the bits. Representation of a signed binary numbers There are three ways of representing a signed number i. Prefixing an extra sign bit to a binary number ii. Using ones complement iii. Using the twos complement Prefixing an extra sign bit to a binary number In decimal number a signed number has a prefix "+" for a positive number e.g. +89 and a "-" for a negative number e.g. - In binary numbers, a negative number is presented by prefixing a digit 1 to the number while a positive number is presented by prefixing a digit 0 Example (^17) 10 =100012 (unsign) -17 10 = to indicate it's a negative number we add an extra bit (1) 10001 2 (^17) 10 = to indicate it's a positive number we add an extra bit (0) 1000l 2 Binary addition Example 1 A + B = SUM + CARRY ANSWER 0 0 0 0 0 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 Example 2 1 1 1 1 CARRY 1 1 0 1 0 1 1 A
1 0 0 1 0 1 1 B 1 0 1 1 0 1 1 0 Answer
5 1 0^0 0 0 1 0 1 0 Answer 1 Add overflow bit if any 0 0 0 0 0 0 0 1 1 Final answer Therefore 8 – 5 = 3 3 = 0011 2
2. Twos complement Like in the ones complement, the twos complement of a number is obtained by adding a positive number to its negative counterpart. Example To get the difference between in 8 - 5 using the ones complement follow the following steps i. Get the binary equivalent of 8 in binary = 00001000 2 ii. Rewrite the problem as 8 + (-5) iii. Convert the absolute value of 5 into an 8-bit equivalent i.e. 0000010l 2 iv. Complement the values i.e. 00000101 2 to v. Add a 1 to the ones complement of 5 i.e. 11111010 2 + 1= 11111011 2 vi. Add the binary equivalent of 8 to the twos complement of 5 vii. Ignore any overflow bit 9 8 7 6 5 4 3 2 1 BIT Ignore Overflow bit 0 0 0 0 1 0 0 0 8 1 1 1 1 1 0 1 0 + 1s complement of 5 plus 1 1 0^0 0 0 1 0 1 1 Answer Ignore overflow bit if any 0 0 0 0 0 0 0 1 1 Final answer Therefore 8 – 5 = 3 3 = 0011 2