Data as the computer sees it 1
Number systems Number systems Data storage Data storage Glossary Glossary 2
Because of their electronics, computers work with only two states – on or off, that is a binary or base 2 number system 3
Base 10 (Decimal) Base 2 (Binary)Base 16 (Hexadecimal) A2CD3E 16 4
Decimal number (base 10): Number Placeholde r column Place value/ Written as base Place value /10 =0,1 1/100 =0,01 1/1000 =0,001 Expanded notation =4 X X X X X X X10 -3 = =
Binary number (base 2):
Hexadecimal numbers (base 16) 7
Engineers discovered that it was easy, from a ‘physical’, engineering point of view, to have just two states – on or off. This could easily be represented by the presence or absence of current flow. Hence at the lowest level, data is represented in binary, to make it easier to design and build hardware. 8
Convert binary numbers to decimal numbers = (1 x 2 3 ) + (0 x 2 2 ) + (0 x 2 1 ) + (1 x 2 0 ) = (1 x 8) + (0 x 4) + (0 x 2) + (1 x 1) = = 9 9
Convert the following binary numbers to decimal numbers, showing all your calculations. 10
Convert hexadecimal to decimal number 2F3 16 = (2 x 16 2 ) + (F x 16 1 ) + (3 x 16 0 ) = (2 x 256) + (15 x 16) + (3 x 1) = =
Convert the following hexadecimal numbers to decimal, showing all your calculations. 12
This is good old primary school division with the remainder! 13
Convert the following decimal numbers to binary numbers. 14
634÷ 16 = 39remainder 10 39÷ 16 = 2remainder 7 2÷ 16 = 0remainder 2 answer is 27A 16 (10 = A) 15
Write the following decimal numbers in hexadecimal notation. 16
Each of these data types is allocated a fixed number of what is termed bytes. Each byte (a number in binary format e.g ) in turn, consists of 8 binary digits or bits. Here is an example of data stored in 4 bytes of 8 bits each, i.e. 32 bits. 17
Each data type is allocated a fixed amount of space (bytes) to store its associated data There is therefore a limit on the data that can be stored –more bytes - larger the range and fewer bytes - smaller the range. Common data types: Integer or whole number Real or decimal or floating point String or text 18
19
A text or string variable that could store a maximum of 5 characters and was assigned the value ‘Addendum’ to the variable. Some of the text can be ‘lost’. We refer to the situation where an integer number is ‘misrepresented’ due to an insufficient number of bits being available, as overflow. Adden 20
Each program/programming language uses different numbers of bytes to store numbers Decimal or real numbers are normally stored in two parts, namely a ‘number’ part and an ‘exponent’ part e.g x Obviously, a loss of accuracy in the exponent part would be critical ! A loss of accuracy in the number part would lead to a loss of accuracy in the number of decimals 21
Coding schemes The ASCII system was the original standard which assigned numeric values to letters, digits, punctuation marks, and other characters 22
Pictures and sound clips Picture is a collection of thousands of dots, each of which can be modelled by representing its position and colour etc.,then we can digitise any picture or video Music too can be modelled by representing the data as numerical values describing volume, pitch and frequency 23
Know the basics 24
Apply your knowledge 25
Think and research 26
ASCIIBinaryBitByte Coding scheme Decimal Hexadecimal Octal Overflow Primitive data type Truncation 27