SLR13 Flashcards
What are the 5 data types
- Integer
- Boolean
- Character
- String
- Floating point / real
Give an example of each data type
- Integer = 1
- Boolean = True / False
- Character = A
- String = “Hello world!”
- Floating point / real = 1.15
What is the process of casting data types
Automatically converting one data type into another
What does MSB stand for
Most Significant Bit
With positive numbers what is generally the MSB
128
In sign and magnitude what is the MSB
+ / -
+ = 0
- = 1
In twos compliment what is the MSB
-128
Can two’s complement store a wider range of numbers than sign and magnitude
Yes
What happens when you add these binary numbers together:
0 + 0
0 + 1
1 + 0
1 + 1
0
1
1
0 with a 1 carried to the next layer
What happens when you add these binary numbers together with a carried 1 before it:
0 + 0 (+ 1)
0 + 1 (+ 1)
1 + 0 (+ 1)
1 + 1 (+ 1)
1
0 with a 1 carried to the next layer
0 with a 1 carried to the next layer
1 with a 1 carried to the next layer
How does a computer work out subtraction
Turns the number that it’s going to subtract into a negative number then adds these two numbers together
How are fractions done with binary and what are they referred to as
A mantissa and exponent
Floating point numbers
What is the mantissa
The actual data the number itself is stored in
What is the exponent
The exponent stores the offset for the floating point in the mantissa
How are characters stored in a computers memory
With character sets, this is where every character has a unique code. Every device uses the same character set so that one letter matches another letter on a different device when sharing data
What are the two types of character set
UNICODE
ASCII
Which character set stores more characters, UNICODE or ASCII and why
UNICODE because it is stored in 24-bit code but as this is unreliable it is stored with a 6-bit hex value. Allowing for over 16,000,000 characters.
While ASCII was stored in a 7-bit code allowing for 128 characters but then later changed to 8-bit code allowing for 256 characters
What are the 4 other operations of the ALU
- Masking
- ANDing
- ORing
- XORing
What is masking
Isolating and extracting specific bit values in a sequence, allowing them to be changed and toggled
What is ANDing
Requires both inputted values to be a 1 in order to result in a 1
What is ORing
Requires either of the inputted values to be a 1 in order to output a 1
What is XORing
Requires either of the inputted values to be a 1 but not both in order to output a 1