P1-12 Flashcards
(13 cards)
Digital computer:
a computer that accepts and processes data that has been converted into binary numbers.
What is binary and why do we use it?
These are transistors. They are tiny electrical components that form the basis of all digital computing devices. They have two distinct states: 1 - On 0 - Off
Bits
A bit is the smallest unit of information that can be processed inside a computer.
A bit can hold one of two symbols, 0 or 1.
Nibbles
A set of 4 bits is called a nibble.
A single nibble can store 16 unique values (2⁴) - the denary numbers 0 - 15.
Bytes
Two nibbles make a byte.
A byte is 8 binary digits.
Is the standard unit of measurement in digital computing.
Represents 256 values (0-255).
Rules for binary addition
0 + 0 = 0
0 + 1 = 1
1 + 1 = 0 carry 1
1 + 1 + 1 = 1 carry 1
Overflow error
Overflow error means that the result of the calculation is too large for the space allocated.
The way a computer handles this will depend on how its set up:
It could crash and report an overflow error.
It could truncate the answer.
It could wrap the number around back to 0.
Sign and magnitude
The most significant bit is the ‘sign bit’.
1= minus
0 = positive
Problems with sign and magnitude
Waste one binary code.
Both 1000 0000 and 0000 0000 represent 0.
Addition doesn’t always work.
two’s complement
The MSB is a minus number as well as a sign bit.
The largest positive number that can be represented is +127 (0111 1111)
The largest negative number that can be represented is -128 (1000 0000)
If it’s positive, make sure to write the + sign.
Denary to binary (negative numbers)
Convert the unsigned equivalent into 8 bit binary Flip the bit (each 1 becomes a 0 and vice versa) Add 1 (arithmetically, not appending)
left shifting
Logical left shifting
MSB is shifted out of the pattern.
Each remaining bit is shifted left.
A new 0 is placed into all vacated spot
Arithmetic left shifting
Same as logical left shifting
right shifting
Logical right shifting
A 0 is always inserted into the vacated MSB.
A 0 is always placed into all vacated spots
Arithmetic right shifting
The MSB is always maintained and copied into all vacated spaces.
Binary to Hexadecimal
hexadecimal to binary
ASCII
ASCII is the American Standard Code for Information Interchange.
ASCII enables computing devices to communicate with another and to translate their communication into identical information.
limitations:
· ASCII is only 7 bits, so can only store 128 (1) unique characters.
· Other languages (1) have characters that cannot be represented with only 7 bits.
· More bits are needed (1) to represent some alphabets.