You are on page 1of 13
Q. What is number system? Explain binary, decimal and hexadecimal number system. Number System: A number system is the system for representation of numeric data. A Number System is defined as a set of values used to represent different quantities. We all are familiar with decimal number system where each number consists of digits fro, 0 to 9. In a computer system, other number systems are also used. E.g. Binary, Hexadecimal ete. 1. Binary Number System: The number system which has base 2 and uses only two digits 0 to 1 to represent any quan ‘These digits are called Binary digits or BIT. Digital computer use this number system to store data, Examples: 101g} 11101) ete. Your name is in the form of alphabets, but for a computer each alphabet has some binary value. Example: the binary value of the letter “Bis 01000010 and its decimal value is 66, 2. Decimal Number system: The number system, which has base 10 and consists of digits from 0 to 9 is called decimal number system, The number system we use in our daily life is the decimal number system Each position represents a specific power of base 10. Examples: 99700) = 9N10? + 9x10! + 7x10° 8760) = 8810? + 7x10! +6x10° 3. Hexadecis Number System ‘The base of hexadecimal number system is 16. This number system uses sixteen different digits (0,1,2,3,4,5,6,7,8.9,A,B.C,D,E.F). Where A=10, BH, C=12, D-13, E14, F=15 Example: 758 a6), 3AA ao ete. Q2 Explain the conversion of Decimal to Binary and Binary to Decimal. Ans: Dec To convert a decimal number to binary, we divide the number by 2 and take quotient and remainder. We continue dividing the quotient by 2 until we get quotient 0. We write out all the remainders in reverse order to obtain the value in binary. Example: Convert the following decimal numbers into binary. a 78 vb. 97 e 129 0 a od 1 - 0 = 0 og 78= (1001110): 97 = (1100001). 129 = (10000001). Binary to Decimal: ‘The conversion of a number from binary number system to decimal number system is explained below with the help ofan example. Example: Convert (1110): to decimal = 1x2? + 1n2? + 1x2! + x2 = 8444240 = (1410 ‘The above conversion is done by the following steps: Step:1 Write down the binary number which is (1110): in this example. Step:2 List the power of two from right to left starting with 0. In this example, the power of 2 starts from 0 and ends at 3. Step:3 Multiply 2’s corresponding powers to each binary value, In the above example there are 4 binary values. Step 4: Compute cach value. Step 5: Add all the values. Step 6: Write the answer along with its base subscript. Examples (a) Convert 01110101) into decimal =ON 241x241 525+ 1824+ 0 ND HN? + On2! HN" = Ox 128+1 x6441x32+1M6+ 0x84 X40N2+1N1 = 0464432+16+0+44041 = 17a) b) Convert 10101001, into decimal = 1827+ ON 2+ 1x 2540 x24 + 1x24. x27 +0241 x2” = 18128 + 0x64 +1 x32 +0 x16 +1x8+0 x4 40 x2 HI = 128 + 0 432+0 +8 +40 +041 = 169¢0, ¢) Convert 00110011) into decimal =ONV+ON2 +1 xDB+1x2+0x2+0x 241x241 x2? =x 128 + 0x64 + 1 x 32H x 164088 +0x4+1x2+181 =O+0432+16+0404241 =Sla0) Q3 Explain the conversion Decimal to Hexadecimal and Hexadecimal to Decimal. Hexadecimal number system has base 16, so for conversion of a number from decimal to Hexadecimal, we divide the number by 16 and take both quotient and remainder. We continue dividing the quotient by 16 until the quotient becomes less than 16. Example: Convert the following decimal numbers into hexadecimal. 278 b.97, 129 a78 is _[- Aa i 78,0 = (AE) b.97 is _|97 op 129 16 {129 8 1 Hexadecimal to Decimal Hexadecimal has base 16, the “place values” correspond to the powers of 16. To convert to Decimal, multiply each place value by the corresponding power of 16. Start this process by writing the powers of sixteen next to the digits ofa hexadecimal number. May = (66 1299-816 Example: Convert the following hexadecimal numbers into decimal. (@ 7Aas ) IC ©) 8949 a)7Aao=()0 =7x 16+ Ax 16 =7x16+10x1 =112+10 = 12a b) 1C2 a= (20 =Inl6? + Cxl6! 42x16? x256 + 1216 +2x1 56% 19242 = 450q0) ©) 8919 =(2) 0 = 8916= (0 x 16149 x 16° =8x16+9x1 28+9 =137a0) Q4 Explain the conversion Hexadecimal to Binary and Binary to Hexadecimal. Hexadecimal to binary To convert a hexadecimal number to binary, simply convert each hexadecimal digit to four digits binary value, To find the four digits binary value, see the Table: Hexadecimal Binary 0000 0001 0010 0011 0100 101 O10 eee eH en 1000 1001 1010 y| ©] 2] a] a) uo} a] oe} 9) 4) (WEBSITE: Wid. FREEILM.COM] NOTES: 9TH COMPUTER - UNIT 2 - LONG QUESTIONS] B 101 c 1100 D 1101 E 1110 7 Wi Examples: Convert (ABS))i« hexadecimal to binary. In this number, there are three hexadecimal digits. Binary of each digit is given as: i For A, the binary value is 1010 For B, the binary value is 1011 For 5, the binary value is 0101 By combining all the binary values, we get 101010110101 So, (ABS)1e = (101010110101). Convert the following hexadecimal numbers into binary. f(a) 7TAag (b) 1C2a9 (€) 8946) (a) 7A a5 =(2)2 Hexadecimal number: Binary equivalent: Tae) OMe) ao 1010) 7TAqe) = 011110102 (b) 1€2a5) = (22 Hexadecimal number: Binary equivalent: las, 0001) Cas 1100) 2a6) 0010.) 1C2a6 = 0001110000102 (©) 8905 =(2)2 Hexadecimal number: Binary equivalent 845) 10002) a6 1001 (2) 8916 = 10001001) also very easy with the help of Table. In the given binary number, we start making groups of four digits from right to left and replace every group with a hexadecimal digi Example: Convert (11000001): to hexadecimal: ‘The four digit binary digits 1100 0001 i, For 1100, the hexadecimal is ii, For 0001 the hexadecimal is 1 So, (11000001): = (CI)i« While making groups from right to left, if the left group has less than 4 binary digits then we simply add 0s on the left. For example, 1010011 has groups 101 0011 and by adding one 0 on the Lefi, it becomes 01010011 nary groups in this binary number are given below where each group has four Convert binary numbers into hexadecimal: (a) 01110101 @) 1. First divide your number into group of four digits starting from the right side So 01110101 is divided into following two group 0111, 0101 2- Convert each group by its Hexadecimal equivalent Binary number Hexadecimal: O1L 1a) =706, 0101 =5a5 So, 01110101.) = 75a6, () 101010012) 1 -First divide your number into group of four digits starting from the right si So 10101001 is divided in following two groups 1010, 1001 2- Replace each group by its hexa equivalent. Binary number: Hexadecimal: 1010g) 10012) So, 10101001 (2)= A916) (©) 00110011¢) 1. First divide your number into group of four digits starting from the right side. So 00110011 is divided into following two group 0011, 0011 2. Convert each group by its hexadecimal equivalent Binary number Hexadecimal. O0L1e = 309 0011e) = 3a So, 00110011(2) = 3316 Q.5 What is Computer Memory? Explain Volatile and Ne Ans: Computer memory is any physical device capable of storing data. There are two types of Computer storage. 1. Volatile Memory (Primary Storage) 2. Non-Volatile Memory (Secondary Memory) 1: Volatile Memory (Primary Storage) A computer memory that only holds its data as long as it has power supply connected to it, is Called Volatile Memory. Random Access Memory (RAM) is an example of volatile memory. RAM is the primary storage device and the data and instructions are stored temporarily in it, RAM Which holds memory only as long as it is connected to power source. As the power supply is disconnected all the data in RAM is cleared. 2: Non-Volatile Memory (Secondary Memory) A device which can hold data even if it is not connected to any power souree, is called Non-Volatile Memory. Secondary memory is used to permanently store data. The data stored ina secondary storage device may be erased or change when required, Examples: Floppy disk, hard disk, flash drives and memory cards ete. Q.6 What is storage device? Describe the difference between following: (a) Internal and external storage (b) Storage and Memory. A Any computing hardware that is used for storing, porting and extracting data, is called a storage device. It can hold or store information both temporarily and permanently. It can also be internal or extemal to a computer. {a) Difference between Internal and External Storage Internal Storage: Internal storage are located on motherboard. Internal storage devices are connected to some fixed slots. To attach an intemal storage device we need to turn off the computer. Examples: RAM, ROM, Hard disk ete. External Storage: An external storage device is a plug and play device, i.e. we just plug it to some port and start using it without turning off'a computer. Examples: Portable Hard Disk, USB Flash Drive etc. (b) Difference between Memory and storage Memory Storage Itis ealled primary memory Itis called secondary memory. Place where an application loads its Data | Usually the place where data is stored for during processing. ong or short term. Temporary storage device. Permanent storage device. Expensive and small storage capacity. Cheap and has large storage capacity. Temporary storage device has fast access. | Permanent storage device has slow access, Connected directly to the processor. Not directly connected to the processor. Examples: RAM and ROM Examples: Floppy disk, Hard Disk ete. Q7 puter Memory. The smallest amount of data to be stored in computer's memory is a 0 or 1. It is called a bit. A collection of eight bits is called a byte. At least one byte is required to store any piece of Information in a computer's storage. ‘The main units of memory are as follows: Units Size Bit ‘Smallest unit of data, can hold only one value: 0 or 1 Byte Group of eight bits, enough space to store single ASCII character Kilobyte _ 1KB = 1,024 bytes Megabyte _1 MB = (1,024) KB or (1,024) bytes Gigabyte _IGB = (1,024) MB or (1,024)' bytes Terabyte _ ITB = (1,024) GB or (1,024 bytes Petabyte _ IPB = (1,024) TB or (1,024) bytes Bit: In digital computers the data is represented as a collection of bits. Bit stands for Binary Digit. A bit is the smallest unit of data and has value | or 0 representing ON or OFF state. Byte: A collection of 8 bits is called a byte. It is a set of bits, which represents a particular character or symbol. In memory one byte ean store only one character Kilo Byte (KB) Combination of 1024 bytes is equal to I KB (Kilobyte) 1 KB = 2!" bytes = 1024 bytes Mega Byte (MB) Combination of 1024 KB is equal to IMB (Megabyte) IMB = 2° bytes = 1024 KB Giga Byte (GB) Combination of 1024 MB is equal to 1GB Gigabyte) 1 GB=2" bytes = 1024 MB ‘Terabyte (IB) Combination of 1024 GB is equal to 1TB (Terabyte) 1 TB =2" bytes = 1024 GB. Peta Byte (PB) Combination of 1024 Terabyte is equal to IPB (Petabyte) 1 PB= 2 bytes = 1024 TB Q8 Explain how data is represented in computer system. Ans: Digital computers store data in binary form. It means that whether it is a text, picture, movie ‘or some application, it is stored in computer's memory in the form of Os and Is. All the characters on your keyboard has an associated code in binary. This code is ealled ASCII code of the Character. ASCII Codes: SCII (American Standard Code for Information Interchange) is one such coding Scheme published by ISO (International Standards Organization). It is a de-facto standard for Representation of data inside computer's memory. It is 7-bit coding scheme. The codes are assigned to various characters. Most computers also use 8-bit ASCII code. ‘The ASCII table which shows the code against each character on your keyboard, The codes are given in decimal form, but inside computer's memory they are represented afler conversion to binary form. DEC 32 space| 64 8 =9@ | 96 pees tae |e uaeeeey Weed (eee gettaee 4 * 66 B 98 b Sot tty Heer tered (ee titi 3% «6s | @&)6Cll| tod 7 % 69 E 101 e 38 & 70 F 102 f sr ae ie Eas: tg 40 ( 2 H 104 h a4 ) B 1 105 i a+ | m 3 | 6 43 + 5 K 107 k ate |e ae tere cee | feel etat a | 7M | 109m 46 % oN | 10 on ar mn of} m o 48 sop | 2 op a9 sg | 3g 50 2 oR | m4 oF 31 3 os | mss 52 a6 | we lt 53 sou lw ou 54 ee ee 55 7 lw | st 56 a xX | wo x 57 go oy jam sy 58 9 oz | mw 2 59 1 : 123 { 60 2 \ | wm ot 61 ig ed | amt Gat ga age 3 Se 9 cee Agcy Example: Convert 2 +2=4 into ASCH code. Solution: Character Decimal Code Binary code 2 30 00110010 + 4B 00101011 2 50 00110010 = 61 0111101 4 52 00110100 So the message in ASCII is 00110010 0010101 100110010 00111101 00110100 Example: To store name of our country “Pakistan”, in computer's memory, we need to store code of each Letter in one byte. As the word "Pakistan" contains 8 letters, so 8 bytes are required for storage. Itis demonstrated in following Table. Human's view about Memory Code in Decimal Code in Binary Human’s view about Code in Decimal ‘Code in Binary memory P 80 01010000 ‘a o7 01100001 K 107 1101011 i 105 01101001 © 115 1110011 v 116 01110100 ‘a 97 01100001 w 110 1101110 Q.9 Describe Boolean proposition? Explain AND, OR and NOT logical operator. Ans: Statements, which are either true or false, such statements are called propositions. For example: Lahore is the capital of Punjat Lahore is the capital of Pakistan Such statements are called propositions. Compound proposition. Sometimes we assemble more than one propositions to make one Proposition called a compound proposition, Truth Values: Every proposition takes one of two values true or false, and these values are called the truth values. Truth value is given on the basis of truthfulness or falsity of a proposition, AND operator. AND operation is used for logical multiplication, AND operator can also be denoted by a dot symbol, It means that P AND Q may also be written as P.Q. If we use "AND" operator to connect two or more propositions, then the compound proposition is true only if all the connected Propositions are true. Example: P= Lahore is the capital of Punjab Q-Lahore is the capital of Pakistan Then P is true and Q is false ‘Now form new proposition T’ by using P and Q as follows: T=PANDQ This proposition is false because Q is false and T to be true both P and Q must be true. ‘Truth table: P Q PANDQ F F F F T F ap F F T T T OR Operator (+): OR operation is used for logical addition, OR operator ean also be denoted by a plus "+" symbol, In OR operator, the compound proposition is true if at least one proposition is true. In other words, the compound proposition is false only if all the propositions are false. It means that POR Q may Also be written as P +Q. Example: P= Lahore is the capital of Punjab Q-Lahore is the capital of Pakistan Then P is true and qis false ‘Now form new proposition T by using P and Q as follows: T=PORQ This proposition is True because P is true and Q is false. Q PORQ F F ii Ts F T i T NOT Operator: ‘NOT operator is an inverter operator. Not is used to negate a proposition. It reverses the 'F’ to “T” and 'T'to'F’. Not operator can also be denoted by a" >" symbol. It means that NOT (P) May also be written as 7 P. Example: P= Islamabad is the capital of Punjab ‘Then make a new proposition Q as follows: Q=NOT (Islamabad is the capital of Punjab) Q= It is not TRUE that Islamabad is the capital of Pakistan Qis called negation of P and we write Q = NOT(P) will be true. ‘Truth tabl Pp NOT (P) F T T F Q.10 Explain Boolean Algebraic laws. Ans: 1. Commutative: Commutative Law states that the order of application of two separate propositions is not important. So, AtB=BtAandA.B=BA A B AB BA F F F F F T F F 3 # 7m F T T T i A B_ | AB] BA F F F F F T T T T F T T if ip i T 2. Associative: According to this law there is no change in results if grouping of expressions is changed, So, A + (B + C)= (A+B) + Cand A (B.C)= (A.B). C A+ (BHC) = (AtB}C A+ (BHC) = (A+B) + A | B | © | AtB | BHC | GBC | AHBO) ' | oe F F F FF [Tt |F T a ae F [il golet fo T a ml Vid y T i T F F T F T 7 +h r 53 T id a af T_ | T T T T T T T T T So proved that A + (BHC) =(A+B)+C A.B.C)=(A. B.C A B CG BO) [ABO | AB) | AB). F F F F F FE F F F T F F F F F T F F F F F F 1 T iT F F F T F F F F F F T F T F F F F r i F F F Tr F T T T T T T iz So proved that A. (B. C)=(A.B).C 3. Distributive: The (.) operation is distributive over (+) and (+) operation is distributive over. Operation so if A, B and C are variables that take values from the set, then: A. (BFC) = (AB) + (AC) and At (B.C) = (A+B). (A+C) ABC) = (A.B) + (A.C) A B Bic AB AC | A@) [ABIAC F 4/3) 4) 4 =) 5)-5) = 4/3) =) =) 4) 4)-5) = 4) =|4] =) 4) =| 4] =] 3] 3] 3} 5] 4) 3) 3) = 3) 5] 5) =| 5] =] =| f=) a) =) =) apap ala) 4s) =|) = af] spe] ef ef] So proved that A.(B+C)=(A.B) + (A.C) At (B.C) = (A+B). (A+ ©) A B Ss Bo) [ABO [@B) [AO [BAG F F F F F F F ¥F F ¥F T F F F TI ¥F F a F F F T F F FE ea iT’ fr ris or a b. r F F F T i T i T = 7 = r <= T T 7 ae F e it ake ae i r T iT e T i T Tr So proved that A + (B.C) =(A +B). (A+C) 4. Identity Law: If a variable is OR’ ed with a False, the result is always equal to that variable. And ifa variable is AND” ed with a True, the result is always equal to that variable. a) AOR False = A, A variable OR’ ed with False is always equal to that variable, b) AAND True = A, A variable AND’ ed with True is always equal to that variable. at : freeilm786@)gmail.com Visit: freeilm.com

You might also like