Topic 2: Data
No description yet. This curated deck is ready for daily study.
Card preview (21)
Why is binary used?
Components inside computers have billions of transistors. Binary is used to represent the transistors inside the component. Transistors can be on or off (1 or 0).
Von Neumann architecture
A structure in which the hardware is connected and organised. It consists of Main Memory and a Central Proecessing Unit interconected by buses. Main Memory (Read)!\_\_\_\_\_¡(Write) Input --> Central Proecessing Unit --> Output The CPU reads and writes data & program instructions to and from main memory.
Overflow
When the result of a binary calculation requieres more bits than are available in the computer hardware (register)
Two’s complement, denary to binary
Remove the - sign Convert the number to binary Flip the bits Add 1
Two’s complement, binary to denary
Remove 1 Flip the bits Convert to denary Add a negative sign (if the original number started with a 1)
Logical shifts
When doubling, shift/move all bits to the left When halving, shift/move all bits to the right
Bit
Binary digit
Image file size formula
File size(bits) = width(px) x height(px) x colour depth(bits)
Hexadecimal
• Used to avoid errors when manipulating numbers • Represend binary numbers using smaller digits (1 hexadecimal digit = 1 nibble) • Computers don’t process hexadecimal
Units
kilobit - 1000 bits megabit - 1000^2 bits gigabit - 1000^3 bits kilobyte - 8 x 1000 bits megabyte - 8 x 1000^2 bits gigabyte - 8 x 1000^3 kibibyte - 1024 bits mebibyte - 1024^2 bits gibibyte - 1024^3 bits
Compression
Reduce file sizes by repackging or removing some data
Lossless compression
Reduce file size while retaining the exact meaning of the original data.
Lossy compression
It reduces file size by permanently deleting some of its data.
How is text represented
Characters in texts
How are characters in text represented
Using the ASCII table, each character has a unique bit pattern. Is a 7-bit code, there are 128 sequences/patterns.
How do computers record sound
With a microphone (or a recording device) a computer will take samples at a fixed interval (usually thousands of samples per second), it will then convert these values into binary to be stored in a file.
Audio file size formula
file size (bits) = sample rate(Hz) x bit depth(bits) x recording length (seconds)
Signed and Unsigned integer
An unsigned integer has no positive or negative sign, a signed one does. Signed: -8, +8 Unsigned: 8
Flowchart symbols
“Sausage” - Start/Stop Rectangle - Process Rhombus - If/elif/else (conditionals) Parallelogram - Input / Output Rectangle with vertical borders - Subprograms
Iteration
Repetition of code
Decomposition
Breaking down a big problem into smaller parts