Topic 1: Data Representation Computer Systems Topic 1: Data Representation
Decimal Number System (3x100) + (4x10) + (5x1) =300 + 40 + 5 =34510 102 101 100 100’s 10’s 1’s 3 4 5 (3x100) + (4x10) + (5x1) =300 + 40 + 5 =34510
Conversion of binary to decimal 27 26 25 24 23 22 21 20 128’s 64’s 32’s 16’s 8’s 4’s 2’s 1’s 1 (1x128) + (0x64) + (1x32) + (1x16) + (1x8) + (0x4) + (1x2) + (0x1) =128 + 32 + 16 + 8 + 2 =18610
Binary to decimal conversion – practice 1011 1 1010 1101 1 0001 0011 111 1111 1000 0000 101 1101 0001 11 1001 0110 110 0010 0101 Binary to decimal conversion – practice
Higher Past Paper Questions 2009 Q1a – Write the binary number 1000100111 as a positive integer. Higher Past Paper Questions
Conversion of decimal to binary – method 1 72 – 64 = 8 8 – 8 = 0
Conversion of decimal to binary – method 2 72 36 R 0 18 R 0 9 R 0 4 R 1 2 R 0 1 R 0 0 R 1 64 32 16 8 4 2 1 = 1 0 0 1 0 0 0 = 64 + 8 = 72
Decimal to binary conversion – practice 134 148 394 29 18 79 273 172 Decimal to binary conversion – practice
Higher Past Paper Questions 2005 Q6a – What is the number 385 represented as a binary number? Higher Past Paper Questions
Range of positive integers 22 21 20 4 2 1 smallest = 0 largest = 7 So for 3 bits, the range is 0..7 0..23 - 1
Range of positive integers 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 smallest = 0 largest = 255 So for 8 bits, the range is 0..255 0..28 – 1 So for n bits, the range is 0..2n - 1
Range of positive integers - practice What is the range of positive integers that can be represented using 8 bits? What is the range of positive integers that can be represented using 12 bits? What is the range of positive integers that can be represented using n bits? Range of positive integers - practice
Maximum positive integer versus range Maximum positive integer is the largest number which can be represented by a number of bits e.g. for 8 bits the maximum positive integer is 28 – 1 = 255 The range involves two numbers, the smallest number and the largest number e.g. for 8 bits the range is 0..255 Maximum positive integer versus range
Higher Past Paper Questions 2011 Q1 – State the largest whole number that can be stored as a 10-bit positive integer. Higher Past Paper Questions