05- Data representation, Study notes of Computer science

This document is a complete guide to understanding the fundamentals of computers, designed for beginners, students, and anyone looking to build a strong foundation in computing. It combines theory with hands-on practice, making it ideal for classroom use, self-study, or training programs Practice Exercises at the end of each chapter: Multiple Choice Questions (MCQs)

Typology: Study notes

2024/2025

Available from 08/21/2025

tyson-rareawm
tyson-rareawm 🇮🇳

5 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download 05- Data representation and more Study notes Computer science in PDF only on Docsity!

Learn, Revise & Practice ~^ Computer Awareness

Octal Number System

It consists of 8 digits from 0 to 7. It is also known as Base 8 system. Each position of the octal number represents a successive power of eight.

A list of the first several powers of 8 is 8 0 = 1 8, 1 = 8 8, 2 = 64 8, 3 = 512 8, 4 = 4096 8, 5 = 32768

Representation of Octal Numbers in Binary Octal Binary Digits 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111

Hexadecimal Number System It provides us with a shorthand method of working with binary numbers. There are 16 unique digits available in this system.

These are 0 to 9 and A to F , where A denotes 10, B denotes 11, ......., F denotes 15.

It is also known as Base 16 system or simply Hex.

So, each position of the hexadecimal number represents a successive power of 16.

A list of the first several powers of 16 is 16 1 16 16 16 256 16 4096 16 65536

0 1 2 3 4

= = = = =

, , , ,

Decimal, Binary and Hexadecimal Equivalents Decimal Binary Hexadecimal 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5

Decimal Binary Hexadecimal 6 0110 6 7 0111 7 8 1000 8 9 1001 9 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F

Conversion between

the Number Systems

Different types of conversion between the number systems are discussed below

Decimal to Binary To convert decimal to binary, following steps are involved Step 1 Divide the given number by 2. Step 2 Note the quotient and remainder. Remainder should be 0 or 1. Step 3 If quotient ¹ 0, then again divide the quotient by 2 and back to step 2. If quotient = 0, then stop the process. Step 4 First remainder is called as Least Significant Bit (LSB) and last remainder is called as Most Significant Bit (MSB). Step 5 Arrange all remainders from MSB to LSB.

Example ( 43 ) 10 ®(?) 2 Remainder 2 43 1 ® LSB 2 21 1 2 10 0 2 5 1 2 2 0 2 1 1 ® MSB 0

Then, (43) 10 ®(101011 ) 2

Binary to Decimal To convert binary to decimal, following steps are involved Step 1 Multiply the all binary digits by powers of 2.

Step 2 The power for integral part will be positive and for fractional part will be negative. Step 3 Add the all multiplying digits.

Example (1101.10) 2 ®(?) 10

(1101.10) 2 = 1 ´ 2 3 + 1 ´ 2 2 + 0 ´ 21

  • 1 ´ 2 0 + 1 ´ 2 -^1 + 0 ´ 2 -^2 = 8 + 4 + 0 + 1 + 0. 5 + 0 = 13.

Then, (^) (1101.10) 2 ®(13. 5) 10

Binary to Octal To convert binary to octal, following steps are involved Step 1 Make the group of 3 bits from right to left. If the left most group has less than 3 bits, put in the necessary number of leading zeroes on the left.

Step 2 Now, convert each group to decimal number.

Example ( 110110100 ) 2 ®(?) 8

110

Then, ( 110110100 ) 2 ®( 664 ) 8

Octal to Binary

Convert every digit of the number from octal to binary in the group of 3 bits.

Example (1034. 5) 8 ®(?) 2

Then, (1034. 5) 8 ®(001000011100. 101 ) 2

Binary to Hexadecimal

To convert a binary number to its hexadecimal equivalent, follow these steps

Step 1 Start making the group of 4 bits each from right to left from the given binary number. If the left most group has less than 4 bits, put in the necessary number of leading 0’s on the left. Step 2 Now, each group will be converted to decimal number.

Example (11110101111011) 2 ®(?) 16

Then, (11110101111011 ) 2 ® ( 3 D 7 B ) 16

Hexadecimal to Binary For this type of conversion, convert each hexadecimal digit to 4 bits binary equivalent. Example ( BA 81 ) 16 ®(?) 2

Then, ( BA 81 ) 16 ®( 1011101010000001 ) 2

Decimal to Octal To convert decimal to octal, following steps are involved Step 1 Divide the given number by 8. Step 2 Note the quotient and remainder. Digits of remainder will be from 0 to 7. Step 3 If quotient ¹ 0, then again divide the quotient by 8 and go back to step 2. Step 4 If quotient = 0 or less than 8 then stop the process. Step 5 Write each remainder from left to right starting from MSD to LSD.

Example (97647) 10 ®(?) 8 8 97647 7 LSD 8 12205 5 8 1525 5 8 190 6 8 23 7 8 2 2 MSD 0 Then, (97647) 10 ®(276557) 8

Octal to Decimal To convert octal to decimal, following steps are involved Step 1 Multiply each digit of octal number with powers of 8. Step 2 These powers should be positive for integral part and negative for fractional part. Step 3 Add the all multiplying digits.

Data Representation 47

¯ ¯ ¯ ¯ ¯ 001 000 011 100 101

¯ ¯ ¯ ¯

D B
B = 11 A = 10 8 1

¯ ¯ ¯ ¯ 1011 1010 1000 0001

BCD

BCD stands for Binary Coded Decimal. This system was developed by IBM. It is a number system where four bits are used to represent each decimal digits. BCD is a method of using binary digits to represent the decimal digits (0-9). In BCD system, there is no limit on size of a number.

ASCII ASCII stands for American Standard Code for Information Interchange. These are standard character codes used to store data so that it may be used by other software programs. Basically, ASCII codes are of two types which as follows

(i) ASCII-7 It is a 7-bit standard ASCII code. It allows 2 7 = 128 (from 0 to 127) unique symbols or characters. (ii) ASCII-8 It is an extended version of ASCII-7. It is an 8-bit code, allows 2 8 = 256 (0 to 255) unique symbols or characters.

EBCDIC EBCDIC stands for Extended Binary Coded Decimal Interchange Code. In EBCDIC, characters are represented by eight bits. These codes store information which is readable by other computers. It allows 2 8 = 256 combination of bits.

Logic Gate

It is a basic building block of a digital circuit that has two inputs and one output. The relationship between the input and the output is based on a certain logic. These gates are implemented using electronic switches like transistors, diodes.

Types of Logic Gate

There are various types of logic gate as follows:

  1. AND Gate This gate is also represented by (×) like ( A B × ). In AND gate, it returns True only if both the conditions or inputs are True otherwise it returns False.

Truth Table of AND Gate

A B X 0 0 0 0 1 0 1 0 0 1 1 1

\ X = A B ×

  1. OR Gate This is represented by ( + )like ( A + B ). It returns True if any one of the conditions or inputs is True and if both conditions are False then it returns False.

Truth Table of OR Gate A B X 0 0 0 0 1 1 1 0 1 1 1 1 \ X = A + B

  1. Inverter or NOT Gate This gate is also represented by (¢) like A ¢. In NOT gate, it returns True if input is false and vice-versa.

Truth Table of NOT Gate

A X = A ¢ 0 1 1 0

  1. NAND Gate It is basically the inverse of the AND gate. This gate is designed by combining the AND and NOT gates. It returns False only if the both conditions or inputs are True otherwise it returns True.

Data Representation 49

Inputs (^) operationLogic Output

A B

X

B

A X

A X

A B

X

Truth Table of NAND Gate A B X 0 0 1 0 1 1 1 0 1 1 1 0

X = ( A B × ) = A + B

  1. NOR Gate It is an inverse of an OR gate. This gate is designed by combining the OR and NOT gates. It returns True only if both the conditions or inputs are False otherwise it returns False.

Truth Table of NOR Gate

A B X 0 0 1 0 1 0 1 0 0 1 1 0

X = ( A + B ) = A B × Note NAND and NOR gates are also called universal gates.

  1. Exclusive-OR or XOR Gate It performs based on the operation of OR gate.

It returns True only if one condition is true from both the conditions otherwise it returns False.

Truth Table of XOR Gate

A B X 0 0 0 0 1 1 1 0 1 1 1 0

X = A Å B X = AB + AB

n (^) UNICODE uses 16-bits to represent a symbol in the data. It represents any non-english character, scientific symbol in any language like Chinese, Japanese. n (^) Sign bit is the most significant bit, i.e. used to represent the sign of a number that could be either + ve or - ve. n (^) One’s complement of binary number is defined as the value obtained by inverting all the bits e.g. 110100 One’s complement is 001011

50 Learn, Revise & Practice ~^ Computer Awareness

B

A X

B

A X

Tit-Bits

17. What type of information system would be

recognised by digital circuits? (1) Hexadecimal system (2) Binary system (3) Both ‘1’ and ‘2’ (4) Only roman system

18. The binary equivalent of decimal number 98

is [IBPS Clerk 2012] (1) 1110001 (2) 1110100 (3) 1100010 (4) 1111001 (5) None of these

19. Conversion of decimal number ( 71 ) 10 to its

binary number equivalent is [IBPS Clerk 2012] (1) ( 110011 ) 2 (2) ( 1110011 ) (^2) (3) ( 0110011 ) 2 (4) ( 1000111 ) (^2) (5) None of these

20. Conversion of decimal number ( 61 ) 10 to its

binary number equivalent is [IBPS Clerk 2012] (1) ( 110011 ) 2 (2) (^) ( 11001110 ) (^2) (3) ( 111101 ) 2 (4) ( 11111 ) (^2) (5) None of these

21. What is the value of the binary number 101?

( 1 ) 3 (2) 5 (3) 6 (4) 101

22. Decimal equivalent of ( 1111 ) 2 is

[IBPS Clerk 2012] (1) 11 (2) 10 (3) 1 (4) 15 (5) 13

23. ( 1010 ) 2 equivalent decimal number is

(1) 8 (2) 9 (3) 10 (4) 11

24. The binary number 10101 is equivalent to

decimal number ............. (1) 19 (2) 12 (3) 27 (4) 21

25. Which of the following is octal number

equivalent to binary number ( 110101 ) 2? (1) 12 (2) 65 (3) 56 (4) 1111

26. Which of the following is a binary number

equivalent to octal number (. 431 ) 8? (1) ( 100011001 ) 2 (2) (. 100011001 ) (^2) (3) ( 100110100 ) 2 (4) (. 100110001 ) (^2)

27. To convert binary number to decimal,

multiply the all binary digits by power of (1) 0 (2) 2 (3) 4 (4) 6

28. Which of the following is hexadecimal

number equivalent to binary number ( 1111 1001 ) 2? (1) 9F (2) FF (3) 99 (4) F

29. Conversion of binary number ( 1001001 ) 2 to

hexadecimal is [SBI PO 2011] (1) ( 40 ) 16 (2) ( 39 ) 16 (3) ( 49 ) 16 (4) ( 42 ) (^16) (5) None of these

30. Conversion of binary number ( 101110 ) 2 to

hexadecimal is [SBI PO 2011] (1) ( 35 ) 16 (2) ( 46 ) 16 (3) ( 2 E ) 16 (4) ( 50 ) (^16) (5) None of these

31. Which of the following is the correct binary

form of 4A2.8D 16? [IBPS PO Mains 2017] (1) 010010100010 10001101. 2 (2) 010110100010 11101101. 2 (3) 011110100010 10001101. 2 (4) (^) 010010111110 10001101. 2 (5) None of the above

32. Which of the following is an octal number

equal to decimal number ( 896 ) 10? (1) 0061 (2) 6001 (3) 1006 (4) 1600

33. Conversion of decimal number ( 42 ) 10 to its

octal number equivalent is (1) ( 57 ) 8 (2) ( 42 ) (^8) (3) ( 47 ) 8 (4) ( 52 ) (^8)

34. Determine the octal equivalent of ( 432267 ) 10

(1) ( 432267 ) 8 (2) ( 346731 ) (^8) (3) ( 2164432 ) 8 (4) ( 123401 ) 8 (5) None of these

35. Determine the decimal equivalent of ( 456 ) 8

(1) ( 203 ) 10 (2) ( 302 ) (^10) (3) ( 400 ) 10 (4) ( 402 ) (^10)

36. Conversion of octal number ( 3137 ) 8 to its

decimal equivalent is (1) ( 1631 ) 10 (2) ( 1632 ) (^10) (3) ( 1531 ) 10 (4) ( 1931 ) (^10)

52 Learn, Revise & Practice ~^ Computer Awareness

37. Conversion of decimal number ( 15 ) 10 to

hexadecimal number is (1) ( 14 ) 16 (2) ( 13 ) 16 (3) ( F ) 16 (4) ( 7 F) 16

38. Conversion of decimal number ( 93 ) 10 to

hexadecimal number is (1) ( 2 D ) 16 (2) ( 5 D) 16 (3) ( 62 ) 16 (4) ( 31 ) (^16)

39. Which of the following is a hexadecimal

number equal to 3431 octal number? (1) 197 (2) 917 (3) 791 (4) 971 (5) 719

40. The method used for the conversion of octal

to decimal fraction is (1) digit is divided by 8 (2) digit is multiplied by the corresponding power of 8 (3) digit is added with 8 (4) digit is subtracted with 8

41. MSD refers as

(1) Most Significant Digit (2) Many Significant Digit (3) Multiple Significant Digit (4) Most Significant Decimal

42. LSD stands for

(1) Long Significant Digit (2) Least Significant Digit (3) Large Significant Digit (4) Longer Significant Decimal

Directions (43 and 44) Triangle represents D (1) and circle represents o (0). If triangle appears in unit’s place then its value is 1. If it appears in 10’s place its value is doubled to 2 like that it continues. Using the given terminology answer the following questions. For example.

D = 1 D D° = 4 0 1, , = 4 + 0 + 1 Do = 2 [IBPS PO Mains 2017]

43. How will you represent ‘87’ in this code

language? (1) o DDD DDo (2) D D DDDo o (3) DD DDDDo (4) D ooD ooD (5) DD DDDo o

44. What will be the code for DD oooD o?

(1) 98 (2) 95 (3) 96 (4) 94 (5) 99

45. How many values can be represented by a

single byte? (1) 4 (2) 16 (3) 64 (4) 256

46. Which of the following is not a computer

code? (1) EBCDIC (2) ASCII (3) CISC (4) UNICODE

47. ASCII stands for [IBPS Clerk 2011,2014]

(1) American Special Computer for Information Interaction (2) American Standard Computer for Information Interchange (3) American Special Code for Information Interchange (4) American Special Computer for Information Interchange (5) American Standard Code for Information Interchange

48. The most widely used code that represents

each character as a unique 8-bit code is [IBPS Clerk 2011] (1) ASCII (2) UNICODE (3) BCD (4) EBCDIC (5) None of these

49. Today’s mostly used coding system is/are

(1) ASCII (2) EBCDIC (3) BCD (4) Both ‘1’ and ‘2’

50. In EBCDIC code, maximum possible

characters set size is (1) 356 (2) 756 (3) 556 (4) 256

51. Code ‘EBCDIC’ that is used in computing

stands for (1) Extension BCD Information Code (2) Extended BCD Information Code (3) Extension BCD Interchange Conduct (4) Extended BCD Interchange Conduct

52. Most commonly used codes for representing

bits are (1) ASCII (2) BCD (3) EBCDIC (4) All of these

Data Representation 53