300 likes | 417 Views
Information Storage 1. Information Storage 1. Later in the course we will be making multimedia In order to make multimedia we need to understand how computers store different media. 000101011010101101010101100101101010101010 0100101010101010101101010101. Computers store information in bits
E N D
Information Storage 1 • Later in the course we will be making multimedia • In order to make multimedia we need to understand how computers store different media
000101011010101101010101100101101010101010 0100101010101010101101010101 • Computers store information in bits • Each bit is either a zero or a one
1 1 bit can be used to indicate if something is on or off 0 = on 1 = off 1 = on 0 = off The meaning is up to us to interpret 1 bit
1 bit 1 • 1 bit can be used to indicate the temperature • 0 <= 37˚ 1 >37˚ • The meaning of the bit is defined somewhere
Traffic Light • How many bits would it take to describe the state of a traffic light?
Traffic Light • How many bits would it take to describe the state of a traffic light? • 2 bits • 00 red • 01 amber • 10 green
00 Green 01 Red 11 Amber The mapping of the bits to the lights is arbitrary Any system is as good as the next How to interpret the bits is usually described in a table Traffic Light
11 Green 10 Red 01 Amber 00 Off In 2 bits it is possible to have 4 different combinations Traffic Light
Bits • How many bits would be needed to give each student in a class a unique code?
Bits • How many bits would be needed to give each student in a class a unique code? • It depends how many there are.
Bits • How many bits would be needed to give each student in a class of 20 a unique code?
2n In general if you have n bits then you can use them to represent 2n different things Combination of bits
… give each student in a class of 25 a unique code? … give each student in a class of 40 a unique? …represent a day of the week? … represent a day of the month? How many bits to …
… give each student in a class of 25 a unique code? … give each student in a class of 40 a unique? …represent a day of the week? … represent a day of the month? 24=16 25=32 25=32 26=64 7 days 23=8 31 days 25=32 How many bits to …
Bytes • Computer memory is organized into groups of 8 bits called bytes • 8 bits = 1 byte • 16 bits = 2 bytes • 32 bits = 4 bytes
Kbytes • Bytes are grouped into Kilobytes or Kbytes • 1024 bytes = 1 K • 2048 bytes = 2 K
Bytes • How many possible different things could you represent with 1 byte? • How may different things could you represent with 2 bytes?
Bytes • How many possible different things could you represent with 1 byte? 256 • How may different things could you represent with 2 bytes? 65536