How Information is Stored In todays lesson we











- Slides: 11
How Information is Stored In today’s lesson we will look at: • different forms of information • how the computer stores different types of information • why it’s useful to think about how information is stored
Forms of Information There are really just four basic types of information that we need to store on a computer: • numbers • text (i. e. alphanumeric characters) • images • sound There are other types, such as video, but there are combinations of the four types listed above – e. g. a sequence of images together with some sound.
How Computer Memory Works • Computers are made of wires and switches and can only really work with pulses of electricity. • All of the data inside the computer, therefore, have to be sent in the form of pulses – a bit like morse code – either on or off. • Computer memory also works in this way – it’s like millions of tiny switches that are all on or off. • All information stored on a computer – numbers, text, images and sound – needs to be stored like this! How is it done?
Numbers • Numbers are stored using something called binary. • This will be the topic of a separate lesson, but it works like this… • The on and off signals in the computer are used to represent 1 and 0. The 0 s and 1 s are grouped into eights – this is called a byte. 128 64 32 16 8 4 2 1 1 0 1 0 1 1 = 171
Text • Text (and, in fact, everything else) is stored inside the computer as a number. • Because there are different alphabets, and different languages and countries use different symbols, such as £ and accented letters, it’s not always done in the same way. • A code will be used – one of the most common is called ASCII (on the next slide). • We will look at this in more detail when we process text in the programming topic.
ASCII Codes ASCII Symbol ASCII Symbol 32 (space) 48 0 64 @ 80 P 96 ` 112 p 33 ! 49 1 65 A 81 Q 97 a 113 q 34 " 50 2 66 B 82 R 98 b 114 r 35 # 51 3 67 C 83 S 99 c 115 s 36 $ 52 4 68 D 84 T 100 d 116 t 37 % 53 5 69 E 85 U 101 e 117 u 38 & 54 6 70 F 86 V 102 f 118 v 39 ' 55 7 71 G 87 W 103 g 119 w 40 ( 56 8 72 H 88 X 104 h 120 x 41 ) 57 9 73 I 89 Y 105 i 121 y 42 * 58 : 74 J 90 Z 106 j 122 z 43 + 59 ; 75 K 91 [ 107 k 123 { 44 , 60 < 76 L 92 108 l 124 | 45 - 61 = 77 M 93 ] 109 m 125 } 46 . 62 > 78 N 94 ^ 110 n 126 ~ 47 / 63 ? 79 O 95 _ 111 o 127
Images • Most images you see on a computer – such as photos, or those on web-pages – are stored as bitmaps. • A bitmap is just a grid of coloured dots. • The number stored will represent the colour of each dot (or pixel). • jpegs, for example, use three bytes per pixel – one each for the amount of red, green and blue.
Sound • Most sounds you hear on a computer – e. g. MP 3, AAC or WMA - are stored as waves. • The number stored is the amplitude (i. e. volume) of the wave at each point in time. Original sound wave “Samples” stored on the computer
Quality • Generally, higher quality files will require more storage space because: – Higher quality images are made up of more and/or smaller pixels – Higher quality sound recordings require samples to be taken more often – some HD sound recordings now take samples 192, 000 times a second • Compression techniques can be used to make files smaller – these will also be covered in a future lesson.
Programs • So far we've only talked about data. • One of the things that distinguishes a computer from, say, a calculator, is that the instructions are also stored in the memory. • These are stored as the numeric opcodes that form the machine code, rather than the instructions that we'd recognise from a high-level language such as Python or BASIC. • The range of opcodes that a processor recognises is known as the instruction set. • It may sound strange, but sometimes it's better to have a smaller instruction set – this is known as RISC (Reduced Instruction Set Computer).
Example ARM Opcodes