1.1.1-1.1.4 Binary, Binary Arithmetic, Hexadecimal, & Overflow Errors

studied byStudied by 3 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 33

flashcard set

Earn XP

Description and Tags

34 Terms

1
Transistor (short for transfer resistance)
A switch or gate for electronic signals. It can switch on (enabling maximum circuit current to flow through) or off (enabling zero collector current to flow through).
New cards
2
A computer is made from many ______________, all of which only understand ____ states: power ____ and power ______.
transistors, 2, on, off
New cards
3
Binary
Base 2, numerical system only containing the numbers 1 and 0.
New cards
4
Binary is used in computers because the zeros can represent power ____ and the ones can represent power _____.
off, on
New cards
5
Computer
Electronic device for storing/processing data, typically in binary form, according to instructions given to it in a variable program. They're essentially calculators made from billions of switches/transistors. Computers can only understand binary, so everything a computer needs to process must be converted to binary, which can be used to store data forms such as numbers, text, images, sound, program instructions, etc.
New cards
6
What type of circuit condition is this?
What type of circuit condition is this?
Open switch (switch not latched) → Current cannot flow through as the circuit is not connected → Power off
New cards
7
What type of circuit condition is this?
What type of circuit condition is this?
Closed switch (switch is latched) → Current can flow through as the circuit is connected → Power on
New cards
8
For every _______ there are __ possible combinations: ____ and _____, if there are n ______, there will be a total of ______ combinations.
bit, 2, 0, 1, bits, 2^n
New cards
9
Denary
Base 10 number system with 10 digits: 0-9, we usually use denary as our default number system and it contains 10 digits because in primitive stages of counting we used our 10 fingers.
New cards
10
Denary placeholders represent powers of ______, binary placeholders work in the _______ way, except they represent powers of _____.
10, same, 2
New cards
11
Binary to denary conversion procedures
  1. Write down the table of binary place holders depending on how many digits are in the number.

  2. Multiply each digit's value by it's corresponding placeholder's value; OR multiply each digit by 2^n (which is equal to its placeholder value), where n = number of digits to the right of the digit that is going to be multiplied in the entire binary number.

  3. Add each binary digit's denary value together.

New cards
12
Denary to binary conversion procedures
  1. Write down table of binary placeholders depending on how many digits are un the number, usually 8 or 16 bits are used.

  2. Put a 0 in the place values larger than the denary number.

  3. Put a 1 in the largest place value smaller than or equal to the denary number (which can only "go in" that place value once).

  4. Subtract the place value from the denary number.

  5. Repeat steps 2-4 for the subtraction result, do this continually until the subtraction result is 0, which is basically where the binary and denary numbers are equivalent.

New cards
13
Most significant bit (MSB)
Bit corresponding to the largest placeholder value, i.e. the bit that is furthest to the left.
New cards
14
Least significant bit (LSB)
Bit corresponding to the smallest placeholder value, i.e. the bit that is furthest to the right.
New cards
15
1 byte can represent any numbers between ____ (0000 0000) to ____ (1111 1111). Likewise, there are _____ possibilities in a binary number containing n bits, of which _____ is the smallest number that can be represented, and ____________ is the largest number that can be represented.
0, 255, 2^n, 0, 2^n - 1
New cards
16
Computers used to use ___ bytes to represent an ___________; nowadays, _____ bytes are used.
2, integer, 4
New cards
17
Data is processed in computers by the ________________________________, which uses __________________ to process this data. Data is stored in specific locations on the ________ known as _____________. When a calculation occurs, the results will be stored in the __________.
central processing unit (CPU), logic gates, CPU, registers, registers
New cards
18

Sense of scale: 1 character of text requires around ________ of storage. A full page of text requires around _________ of storage. 1 small digital colour photograph requires around ___________ of storage. Music CD capacity requires around _____________ of storage. DVD capacity requires around ______________ of storage. Hard disk capacity requires around ______________ of storage.

1 byte, 30KiB, 3MiB, 650MiB, 4.5GiB, 1TiB
New cards
19
Even binary numbers end in \____; odd binary numbers end in \_____.
0, 1.
New cards
20
Hexadecimal
Base 16 number system, placeholders are powers of 16, we only have 10 digits (0-9), so the letters A (10), B(11), C(12), D(13), E(14), and F(15) are used to represent 10-15.
New cards
21
Why is hexadecimal used?
It's easier for humans to understand because it's a shorter, more concise representation compared to binary. Hexadecimal values are easier to remember and enter, they are more convenient to operate with. People are less likely to make an error with hexadecimal (sometimes abbreviated as hex) than with binary as hex comparatively has less digits.
New cards
22
Uses of hexadecimal
  1. HTML/CSS Colour Codes

  2. MAC Addresses

  3. Assembly Codes and Memory Dumps

New cards
23
How do hexadecimal HTML/CSS colour codes work?

These contain 6 digits following after a # sign:

  1. The first 2 digits show how much red (00 to FF has 255 possibilities) there is

  2. The 3rd and 4th digits show how much green (00 to FF has 255 possibilities) there is

  3. The last 2 digits show how much blue (00 to FF has 255 possibilities) there is

  4. Example: #FF059A - this shows the R value for red is FF (255), the G value for green is 05 (5), and the B value for blue is 9A (154).

New cards
24
Hexadecimal MAC addresses
Media Access Control address, a number which uniquely identifies a device on the internet. The MAC address relates to the network interface card (NIC) inside of the device. (e.g. D5-BE-E9-8D-44-9C). Expressing MAC addresses in hexadecimal format makes them easier to read and work with.
New cards
25
Network Interface Card (NIC)
Hardware needed to allow a computer to connect to a network.  They can be for both wired and wireless networks.
New cards
26
Assembly code
A type of low-level programming language that is intended to communicate directly with a computer's hardware.
New cards
27
Memory dump
Taking all the information in your device's working memory (RAM) and creating a copy of it in your computer's hard drive.
New cards
28
Why is hexadecimal better to use for assembly codes and memory dumps than binary?

Hexadecimals are beneficial (over binary) because:

  • They are easier and faster to work with, taking up less screen space

  • Mistakes are less likely and easier to trace / debug

New cards
29
Hexadecimal to denary conversion procedures
Draw the placeholders for hexadecimal, depending on the number of digits involved. Multiply each digit (0-F) by the corresponding placeholder's value, or by 16^n, where n \= number of digits to the left of the digit being multiplied in the entire hex number. Add each hexadecimal digit's denary value together.
New cards
30
Denary to hexadecimal conversion procedures
Divide the denary number by the largest hexadecimal placeholder smaller than it. (The quotient is the value for that placeholder). Divide the remainder by the largest hexadecimal placeholder smaller than it. (The quotient is the value for that placeholder). Repeat this division until the remainder ≤ 15 (F), i.e. when the remainder can be represented by the units hexadecimal placeholder.
New cards
31
Binary to hexadecimal conversion procedures
A nibble (4 bits) in binary has a maximum value of 1111 (or 15 in denary), which is also the same as the maximum value for a single hexadecimal digit. We can convert binary to hexadecimal by separating the digits into nibble groups, starting from the least significant bit to the left (most significant bit), then converting each nibble to a corresponding hexadecimal value before rejoining these values to get the final result. If the remaining most significant bits do not form a nibble, you can add extra zeros until they do.
New cards
32
Hexadecimal to binary conversion procedures
Convert each hexadecimal digit into a nibble in binary.
New cards
33
Binary addition rules

0 + 0 = 0

0 + 1 = 1

1 + 0 = 1

1 + 1 = 2 (denary) = 10 (binary) → unit digit of 0 but must carry the 1 over to the next placeholder value.

1 + 1 + 1 = 3 (denary) = 11 (binary) → unit digit of 1 but must carry the 1 over to the next placeholder value.

Generally:

Odd number of ones added together → unit digit = 1 and carry necessary amount of 1s over to the next placeholder(s) (depending on how many 2s or powers of 2s are created from the addition)

Even number of ones added together → unit digit = 0 and carry necessary amount of 1s over to the next placeholder(s) (depending on how many 2s or powers of 2s are created from the addition)

New cards
34
Overflow error
When the result of an addition is too large for the predefined limit regarding the number of bits the computer works with or can store. An overflow error occurs when a value outside this limit should be returned. The processor does not have enough bytes/bits available to process an instruction. As a result, the CPU drops the overflow digit because the computer cannot store it anywhere due to limited memory storage space, which could result in loss of accuracy. For example, when a value is greater than 255 in an 8-bit register, an overflow error will occur.
New cards
robot