Chapter 2 Flashcards
What numerical system is used to store all information in a microprocessor? And in computing datasheets?
Respectively the binary and hexadecimal systems.
What is the simplest type of data number in binary?
Unsigned integers.
How many unique combinations can N bits represent for unsigned integers? For signed integers?
They can both represent 2^n integers, however the range differs:
- Unsigned integers : [0, 2^n - 1]
- Signed integers: [ -2^(n-1), 2^(n-1) - 1]
How do you determine the binary code of a negative integer in the two’s complement system?
You first need to take the one’s complement by inverting all the bits, and then add 1 to the result.
What does the Most Significant Bit (MSB) represent in two’s complement encoding?
The MSB is the sign bit:
- 0 = positive number
- 1 = negative number
What is a fixed-point number system?
System where some of the binary digits represent the numbers before the binary point, and some after.
Where the binary point occurs exactly has to be agreed by the creator and user of the fixed-point number.
What system allows very large or small numbers to be represented with high accuracy in binary?
Floating point number system; it is comparable to scientific notation, several digits can exist after the decimal point to increase accuracy and the use of the exponent.
What is Binary Coded Decimal (BCD)?
Numeration system where 4 bits are used to encode each decimal digit (0-9).
How is text information stored in binary?
Using encoding schemes: encoding each character using ASCII, Unicode…
What does ASCII use to encode characters?
Simplest scheme: uses 7 bits to encode letters of the western alphabet and various other symbols.
What is Unicode? How does it differ from ASCII?
More complex scheme: uses up to 32 bits, and currently encodes around 110,000 different characters.
It is able to encode different alphabets and technical symbols —> lots more beyond the ASCII characters.
What is the difference between upper- and lower-case letters in ASCII encoding?
To convert from an uppercase character ASCII code to its lowercase equivalent, we add Ox20 (hexadecimal) = we flip the 6th bit.
How are Boolean true/false values represented in binary?
1 = True
0 = False
What is a data word in a microprocessor?
A block of bits used to store a number, typically 8, 16, 32, or 64 bits.
What is the word size of the PIC 16F884A microprocessor?
8 bits (a byte).
What happens if a word size is too large or too small for the data?
Too large: the extra bits will be 0 – essentially unnecessary.
Too small: the word cannot represent the full value of the data, additional bits are needed.
How do you extend a signed integer to fit a larger word size? And an unsigned integer?
Signed integer: repeat the Most Significant Bit (MSB) to fill the additional bits.
Unsigned integer: add leading zeros to fill the additional bits.