Section 4-Data Representation Flashcards

1
Q

What are logic gates?

A
  • Logic gates are special circuits built into computer chips. They receive binary data, apply a Boolean operation, then output a binary result
  • Logic diagrams are often drawn to show logic gates and circuits. Each type of logic gate is shown by a different symbol
  • Each type of logic gate also has a corresponding truth table. Truth tables show all possible input combinations of 1s and 0s, and the corresponding outputs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the different types of logic gates?

Also learn the symbols for each logic gate

A

There are three logic gates:

  • NOT Gate-Not gates take a single input and give a single output. The output is always the opposite value to the input. e.g. if the input is 1, the output will be 0 and vice versa
  • AND Gate-And Gates take two inputs and give one output. If both inputs are 1, the output is 1, otherwise the output will be 0
  • OR Gate-OR Gate takes two inputs and gives one output. If one or more inputs are 1, then the output is 1, otherwise the output is 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why are logic gates combined?

A

1) Multiple logic gates can be added to the same logic circuit to carry out different operations.
2) You can work out the truth tables by working out each gate in order. For every input combination, follow them through each gate step-by-step, then write down the output
3) By using brackets and the terms AND, OR and NOT, circuits can be written as logical statements, like NOT(A AND B). Operations in brackets should be completed first, just like in normal Maths

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is binary code?

A
  • Computers use 1s and 0s to represent the flow of electricity. 1 is used to show it is flowing and 0 is used to show it is not flowing
  • All the data we want a computer to process must be converted into binary code
  • Each 1 and 0 in a binary code is a bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a bit(b)?

A

A single binary digit (1 or 0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a nibble?

A

4 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a byte?

A

8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a kilobyte(kB)?

A

1000 bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a megabyte(MB)?

A

1000 Kilobytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a gigabyte(GB)?

A

1000 megabytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a terabyte(TB)?

A

1000 gigabytes`

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How is counting in binary similar to counting in decimal?

A

1) In our standard number system we have ten different digits (0 1 2 3 4 5 6 7 8 9). This is called decimal, denary and base 10
2) Binary only uses two different digits (0 and 1)- we call this base 2
3) Counting in binary is similar to to counting in decimal, but the place values from right to left increase by powers of 2 (e.g. 128 64 32 16 8 4 2 1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the binary equivalents to numbers 1-15?

A
0=0
1=1
2=10
3=11
4=100
5=101
6=110
7=111
8=1000
9=1001
10=1010
11=1011
12=1100
13=1101
14=1110
15=1111
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are binary shifts?

A

-A binary shift (also known as a logical shift) moves every bit in a binary number left or right a certain number of places
-Binary shifts can be used to multiply or divide a number by 2
-Gaps at the beginning or end of the number are filled with 0s
-(Towards)Left shifts multiply a binary number. For every place shifted left, the number is doubled
-(Towards)Right shifts divide a binary number. For every place shifted right, the number is halved
-e.g.:
If a number is shifted three places right, it would have halved three times
If a number is shifted three places left, it would have doubled three times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is hexadecimal?

A
  • Hexadecimal (or base-16) uses sixteen different digits
  • a single hex character can represent any decimal number from 0-15. To represent 0-15 in binary would require 4 bits (a nibble), so each hex character equates to a nibble in binary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why do programmers prefer hex when coding?

A
  • It is simpler to remember large numbers in hex- they are far shorter than binary numbers
  • Due to hex numbers being shorter, there is less chance of errors
  • It is easier to convert between binary and hex than binary and decimal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the hexadecimal for numbers 0-15 in decimal?

A
0-0
1-1
2-2
3-3
4-4
5-5
6-6
7-7
8-8
9-9
10-A
11-B
12-C
13-D
14-E
15-F
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How do you convert hex to decimal?

A

In hex, moving right to left, place values increase in powers of 16 (e.g. 4096 256 16 1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How do you convert binary to hex?

A

1) Each hex character is equal to a nibble in binary, so it is possible to convert binary to hex by splitting the binary code into 4-bit chunks
2) Binary to hex conversions can be much easier than converting from binary to decimal, as you only have to deal with the nibbles one at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you convert hexadecimal to binary?

A

-Convert each hex character into binary, then just put the binary numbers together

21
Q

How can binary be used to represent characters?

A
  • Alphanumeric characters are used to make words and strings. They include upper case and lower case letters, the digits 0-9, and symbols like !,”,£,$
  • Computers are unable to process these characters as they only process binary code. So they need a way of converting these characters to binary code and vice versa. They can do this via a character set
  • As well as the alphanumeric characters mentioned above, character sets also contain special characters which do certain commands
  • When you press a button on your keyboard, it sends a binary signal to the computer telling it which key you pressed. The computer then uses the character set to translate the binary code into a particular character
22
Q

What is a Character set?

A

Collections of characters that a computer recognises from their binary representation

23
Q

What is ASCII (American standard code for information interchange)?

A
  • ASCII is the most commonly-used character set in the English-speaking world. Each ASCII character is given a 7-bit binary code- this means it can represent a total of 128 different characters, including all the letters in the English alphabet, numbers, symbols and commands
  • An extra bit (0) is added to the start of the binary code for each ASCII character. This means each character can fit into 1 byte
  • The codes for numbers, uppercase and lowercase letters are ordered with symbols and commands scattered around
24
Q

What is Unicode?

A
  • Unicode comes in several different forms and tries to cover every possible letter or symbol that might be written. Unlike ASCII, Unicode uses multiple bytes for each character
  • Unicode covers all major languages, even those that use a completely different alphabet like Greek, Russian and Chinese
  • The first 128 codes in Unicode is the same as ASCII
25
Q

How are images stored?

A
  • They are stored as a series of pixels
    1) The type of image you use the most often is bitmap-mainly used for photos. They are made up of lots of tiny dots, called pixels
    2) The colour of each pixel is represented by the binary code. The number of colours available in an image is related to the number of bits the code has
    3) Black-and-white images only use two colours, so they only need 1-bit to represent each pixel (0 for white and 1 for black)
    4) 2-bit images can be made up of four colours. Each pixel can be one of four values-00,01,10,11
    5) You can make a greater number of shades and colours by increasing the number of bits of each pixel
26
Q

What is the full form for pixel?

A

Picture Elements

27
Q

How does colour depth and resolution affect the file size?

A

-Increasing both of these conditions will increase the file size.
This is because it increases the number of bits in the image. This can give a higher quality image, but also increase the file size

28
Q

What is colour depth?

A

Colour depth is the number of bits used for each pixel

29
Q

How do you work out the number of colours can be made?

A

Total number of colours= 2n

where n= number of bits per pixel, or bpp

30
Q

How do you work out the file size?

A

File size (in bits)= image resolution * colour depth= width * height * colour depth

31
Q

What is image resolution?

A

The image resolution is the number of pixels in the image. It is sometimes given by width*height. The higher the resolution, the more pixels the image is made of, so the better the quality of the image.

32
Q

How do you store sound?

A
  • Sound is sampled and stored digitally
  • Sound is recorded by a microphone as an analogue signal. Analogue signals are pieces of continually changing data
  • Analogue signals need to be converted into digital data so that computers can read and store sound files. This is done by analogue to digital converters, which are found in most modern recording devices
33
Q

What is sampling?

A

The process of converting analogue to digital

34
Q

What is sample rate?

A
  • is how many samples you take in a second

- usually measured in hertz(Hz) or kilohertz(Kz)

35
Q

What is sample resolution?

A

Number of bits available for each sample

36
Q

How do you calculate the size of a sound file/

A

File size (in bits)=Sample Rate (in Hz)Sample resolutionlength(in seconds)

37
Q

How does sample rate affect size and quality sound files?

A

Increasing the sample rate means the analogue recording is sampled more often. The sampled sound will therefore be of better quality and will more closely match the original recording. This will increase the file size

38
Q

How does sample resolution affect size and quality sound files?

A

Increasing the sample resolution means the digital file picks up quieter sounds, even if they are happening at the same time as louder ones. This will also result in a sampled sound that is closer to the quality of the original recording. This will increase the file size

39
Q

What is compression?

A

-Data compression is when we make file sizes smaller, while trying to make the compressed file as true to the original as possible

40
Q

What are the uses of compressing data?

A
  • Smaller files take up less storage on a device
  • Streaming and downloading files from the internet is quicker as they take up less bandwidth
  • It allows web pages to load more quickly in web browsers
  • Email services normally have restrictions on the size of the attachment you can send- compressing the file allows you to send the same content with a much smaller file size
41
Q

What are the two types of compression and what do they do?

A
  • Lossy- works by permanently removing data from the file- this limits the number of bits the file needs so reduces its size
  • Lossless- makes the file smaller by temporarily removing data to store the file and then restores it to its original state when it is opened
42
Q

What are the advantages and disadvantages of Lossy compression?

A

Advantages:
-Greatly reduced file size, meaning more files can be stored
-Takes up less bandwidth so can be downloaded and streamed more quickly
-Commonly used- lots of software can read lossy files
Disadvantages:
-It loses data-the file cannot be turned back into the original
-Cannot be used on text or software files as these files need to retain all the information of the original
-Worse quality than the original, but this difference is usually unnoticeable

43
Q

What are the advantages and disadvantages of Lossless compression?

A

Advantages:
-Data is only removed temporarily so there is no reduction in quality- the compressed file should look or sound like the original
-They can be decompressed- turned back into the original
-Can be used on text and software files
Disadvantages:
- Only a slight reduction in file size, so lossless files still take up quite a bit of space on your device

44
Q

Examples of lossy file type:

A
  • MP3 (audio)
  • AAC (audio)
  • JPEG (image)
45
Q

Examples of lossless file type:

A
  • FLAC (audio)
  • TIFF (image)
  • PNG (image)
46
Q

What is run-length encoding?

A
  • (RLE) is a form of lossless compression. This means the process reduces a file size without losing any data
  • It looks for consecutive repeating data in a file- called a run. Instead of storing each piece of repeated data separately, it just stores the number of times it has been repeated, and one copy of the data
47
Q

How can you use RLE (Run Length Encoding) to compress the different types of data?

A

1) Run-length encoding can also be applied to text. For example, say we have a string ‘wwwwwhtttt’. In ASCII, this would use one byte for each character, so 10 bytes altogether
2) Looking for runs, we can see that ‘w’ occurs 5 times, then ‘h’ once and then ‘t’ four times. As data pair, this would be: (5, w) (1, h) (4, t), so this can be stored as 6 bytes rather than 10
3) You can also use RLE to encode binary data. But be warned- because 1s and 0s just take up 1 bit each, you need very long runs of repeated data for it to actually reduce the size

48
Q

What is Huffman coding?

look online how one looks and functions

A
  • Huffman coding uses the frequency of each data value
    1) Each data value in a file (e.g. a character in a text file) takes up the same amount of space
    2) Huffman coding gives each data value a unique binary code but the codes vary in length. It gives shorter binary codes to data values that appear more frequently