3.3 Data Representation Flashcards
1) How do computers represent all data and instructions, in terms of hardware?
2) What are transistors?
3) What is binary?
4) What do the subscripts (tiny numbers) represent?
1) Computers use electric circuits and switches to represent all data and instructions.
2) The tiny switches in a computer are called transistors. Transistors allow electricity to be on or off in a circuit.
3) Binary, also called base 2, is a number system that uses 2 digits: 1 and 0. You multiply place values by 2 as you move from right to left.
4) The subscript eg. ‘₂’ shows the number base. For example, a number written using base 2 would have the subscript 2.
1) What is a bit?
2) What is a byte, and how many different values can you hold in a byte?
3) What is an overflow error?
1) A bit is a binary digit (1 or 0).
2) A byte consists of 8 bits. You can hold decimal numbers 0 - 255, (256 different values) in a byte.
3) Overflow occurs when the result of a calculation requires more bits - place values - than are available.
1) What is hexadecimal?
2) Why is hexadecimal used (list 3 reasons)?
3) What are the applications of hexadecimal?
1) Hexadecimal, also called base 16, is a number system.
It uses 16 digits: 0–9, then A (10), B (11), C (12), D (13), E (14), F (15). You multiply place values by 16 as you move from right to left.
2) - Hexadecimal is easier for humans to read than binary.
- Numbers are displayed in a more compact way in hexadecimal than in binary
- It is quicker to type in hexadecimal numbers than binary numbers, and it reduces the risk of typing errors.
3) - HTML colour codes, to represent colours
- The MAC address of a device
- An error code for a program
- Part of a file or memory dump
1) What is a character set?
2) Explain what ASCII is
3) Explain what unicode is
4) How are character coding tables commonly arranged.
5) What is the advantage of using unicode over ASCII?
1) A character set is a complete set of the characters and their number codes that can be recognised by a computer system.
2) ASCII is a character set. It has 7 bits, so can represent 128 characters.
3) Unicode is a character set. Unicode uses up to 4 bytes per character. Unicode is an extension of ASCII, and uses the same codes as ASCII up to 127.
4) Character codes are commonly grouped and run in sequence within encoding tables. For example in ASCII ‘A’ is coded as 65, ‘B’ as 66, and so on, meaning that the codes for the other capital letters can be calculated once the code for ‘A’ is known. This pattern also applies to other groupings such as lower case letters and digits.
5) Unicode is needed for data representation of different alphabets and of special symbols such as emojis allowing a far greater range of characters.
1) Explain what a pixel is
2) Explain how the image size is described
3) Explain what a bitmap is
1) A pixel is short for ‘picture element’. It is the smallest element in an image.
2) The size of an image is expressed directly as width of image in pixels by height of image in pixels using the notation width x height.
3) A bitmap is a way of representing an image using a grid arrangement of pixels.
1) Explain what colour depth is
2) How does the number of pixels and the colour depth of an image affect the file size?
3) What is the formula to calculate an image’s file size/ image’s representation size in bits and bytes?
1) Colour depth is the number of bits used to represent each pixel.
2) The higher the numbers of pixels in an image, the larger the file size. The higher the colour depth is in an image, the larger the file size.
3) File size = (bits) = W x H x D
File size = (bytes) = (W x H x D)/8
W = image width
H = image height
D = colour depth in bits
1) Explain what must be done to store sound on a computer
2) What is a sample?
3) Explain how a sound wave is converted so that it can be stored in a computer
1) Sound is analogue, but computers store digital data as binary. Therefore, it must be converted to a digital form for storage in a computer. Analogue signals are sampled to create the digital binary version of sound.
2) A sample is a measure of amplitude at a point in time.
3) A microphone detects the sound wave. The wave is converted to an electrical analogue signal. The amplitude of the wave is measured. Sampling takes place at regular intervals, and these samples are stored as binary values.
1) What is a sample rate, and what is it usually measured in?
2) What is a sample resolution?
3) What is the formula to calculate the file size of sound files?
1) Sampling rate is the number of samples taken in a second and is usually measured in hertz (1 hertz = 1 sample per second).
2) Sample resolution is the number of bits per sample.
3) File size (bits) = rate x res x secs
rate = sampling rate
res = sample resolution
secs = number of seconds
1) What is data compression?
2) State 3 reasons why data is compressed
3) What are the 2 types of compression?
1) Compression is used to make file sizes smaller. Compression occurs when an algorithm is used to determine how to shrink the size of the data.
2) Data is compressed because:
- To speed up file transfer and download times
- To use less storage capacity
- To use less memory
3) The 2 types of compression are:
- Lossy compression
- Lossless compression
1) What is lossy compression?
2) State examples of lossy filetypes
3) What is lossless compression?
4) State examples of lossless filetypes
1) Lossy compression removes some of the original data from the file, for example reducing the number of colours in an image.
- Lossy compression removes the bits of data that are redundant, unimportant or imperceptible.
- Once a file has been compressed using lossy compression, the removed data can never be restored.
2) Lossy filetypes include JPG, MP3.
3) Lossless compression does not reduce the quality of the file. No data is removed, so when the compressed file is restored, it looks exactly the same as the original. However, you do not save as much space with lossless compression as you would with lossy compression.
4) Lossless file types include PNG, GIF
1) Explain how data can be compressed using Huffman coding
2) How do you calculate the number of bits required to store a piece of data compressed using Huffman coding?
3) How do you calculate the number of bits required to store a piece of uncompressed data in ASCII?
1) A Huffman code analyses the frequency with which characters in a body of text are used. Characters are then placed in a binary tree structure where the most frequently occurring characters are placed nearest the top of the tree.
2) Using the tree, a letter would be encoded as 1 or 0 following the path left or right. Add the number of digits that is represented for each letter together.
3) Multiply the number of characters by 7, because ASCII uses 7 bits.
1) What is Run Length Encoding (RLE)?
2) Explain how Run Length Ecoding works using binary
1) Run length encoding finds groups of repeating data and records the data only once along with the number of times it was repeated. When data is uncompressed it is restored exactly as it was in the original.
2) In run length encoding, first how many of the binary digit there is is written down, and then which binary digit it is. For example, 4 ‘0’s and 12 ‘1’s would be written as 40 121.
1) How do you convert from decimal to binary?
2) How do you convert from binary to decimal?
1) To convert from decimal to binary, start by subtracting the biggest place value possible from the decimal number, then place a 1 in that place value column. Next, subtract the second biggest place value possible, and place a 1 in the column. Repeat this process until zero is reached.
2) Start by writing out the binary place values. Then, add up the numbers that have a number in the ones column together.
1) How do you convert from hex to decimal?
2) How do you convert from decimal to hex?
1) To convert hex to decimal, take each place value that has a unit in it, multiiply the number below by its place value header and add them together.
2) If the denary number is bigger than 16, divide it by 16. Take the hex equivalent of this result - this represents the first digit. Take the hex equivalent of the remainder - this represents the second digit.
If the denary number is smaller than 16, take the hex equivalent of the denary number.
1) How do you convert from hex to binary?
2) How do you convert from binary to hex?
1) Split the hexadecimal number into individual digits. Convert each hexadecimal digit into its binary equivalent (a nibble). Combine the nibbles to make one binary number.
2) Start at the rightmost digit and break the binary number up into groups of four digits. These are known as nibbles. Next, convert each group of four digits into denary. Convert each denary value into its hex equivalent. Finally, put the hex digits together.