Primitive data types, binary, and hexadecimal Flashcards
Another name for float
real
How do you convert from binary to hexadecimal?
You split the binary number into groups of four starting from the right, and you then convert each group into the corresponding hexadecimal number. For example the binary number 1010 0101 would be:
1010 = 2+8=A
0101 =1+4=5
thus, 1010 0101 = A5
How do you convert from hexadecimal to binary?
You convert into denary form first and then convert the following denary number into binary form.
What’s a byte?
A byte is set of 8 bits made up of 0s and 1s that holds one character of text.
The ASCII is made up of how many bits?
7 bits commands or characters in the original version but 8 in the second version
How many bits combination does theASCII uses?
128 or 256 in the second version
UTF-16 vs UTF-32 Unicode
One uses commands and characters that are represented by using 16 bits, while the other 32.
Both are compatible with ASCII’s commands and characters, and enabled more characters from other languages to be used such as greek and chinese.
When subtracting 2 denary numbers to then convert the answer into binary form what are the steps involved?
Take the positive denary number and convert into a signed binary number.
The next number will be converted into its postive version, and then by switching the bits and adding 1, you are converting into a negative signed binary number.
Add the 2 numbers, and check for any overflow error caused by a carrier bit.
Define Normaniisation
The process of moving the binary point in order to provide the maximum level of precision for a given number of bits.
Define underflow
When a number is too small to be represented in the allocated number of bits, so when divided by a number greater than 1 the answer may be represented by 0.
What does a logical right shift do?
causes the least significant bit to be shifted into the carry bit, and a 0 moves into the most significant bit to occupy the vacated space.
What does a logical left shift do?
causes the most significant bit to be shifted into the carry bit, and a 0 moves into the least significant bit to occupy the vacated space.
What does a left arithmetic shift does ?
It has the effect of multiplying by 2. It bypasses the sign bit and shifts the most significant bit into the carry bit, and the carry bit into the least significant bit.
What does a right arithmetic shift does?
It has the effect of dividing by 2. It takes in account the sign bit and shifts that binary number into the most significant bit, while the least significant bit is shifted into the carry bit.
What does a rotate/circular right shift does?
The value in the least is shifted into the carry bit, and the carry bit is shifted into the most significant bit.
What do 1s and 0s represent to logical instructions
True and False
What are the 4 logical instructions
AND
XOR
OR
NOT
Describe the function and effect of AND operation
If both inputs are equal, then returns true
Describe the function and effect of OR operation
If one or both inputs are equal, then returns true
Describe the function and effect of NOT operation
If value is false, returns true
Describe the function and effect of XOR operation
If one of the inputs is true both not both, returns true
What is a character set?
A character set is a published collection of codes and corresponding characters which can be used by computers for representing text.
Two widely used character sets are…
ASCII and Unicode.
What does ASCII stands for?
Stands for American Standard Code for Information Interchange