2. Real Numbers & Integers All numbers belong to the set or group called real numbers . Inside the set of real numbers is a set of all positive and negative whole numbers. This set is called integers . Real numbers -4.6 2.46 13.7 Integers 0 -7 5 221 -31 100.052 -52.414 0.0014
3. Signed Bit Representation The simplest way of representing a negative number in binary is to use the first bit of the number to represent whether the number is positive or negative: 011 = 3 111 = -3 This is known as signed bit representation. The problem with signed bit representation is that there are 2 values for zero: 000 = 0 100 = -0
4.
5.
6.
7.
8.
9. Range The number of integers which could be stored in one byte (8 bits) is 2 8 = 256 The range of integers which could be stored in one byte (8 bits) using Two’s Complement is -128 to +127 Why does there seem to be one less positive number? There are 255 numbers plus the value 0 . So there are 256 numbers in all.
10. Range What range of numbers could be stored in two bytes using twos complement? 2 16 = 65536 The range of integers which could be stored in one byte (8 bits) is -32768 to +32767 This method of representing large numbers is unsuitable because of the increased memory needed to store the large number of bits needed. A solution to this is to use Floating Point Representation .
11. Credits Higher Computing – Data Representation – Representation of Negative Numbers Produced by P. Greene and adapted by R. G. Simpson for the City of Edinburgh Council 2004 Adapted by M. Cunningham 2010