Important to remember is that the decimal point must be between a 0 and a 1. 0.1 or 1.0.
Q1) Using a 7-bit mantissa and a 5-bit exponent using 2's complement format write the smallest number that can be represented:
1.000000 10000
b) Work out what the denary number 416 would be as a binary floating point number with a 7-bit mantissa and a 5-bit exponent.
011010000.0=416
0.1101000 01001
c)1.001110 00100
e) Type of error.
If two large numbers are multiplied together- This will create an overflow.
If a small number is divided by a large number- this will create an underflow
Q2) A floating point number uses a 8-bit mantissa and a 4-bit exponent.
In binary, write the largest positive number that can be represented using this normalised floating point system.
0.1000000 1000
b) Calculate the denary number of this floating point number.
1.0101000 0011 = -5.5
c) Write the normalised floating point representation of the denary value 13.625 in the boxes below.
01101.101
0.1101101 0100
d) Write the normalised floating point number of the denary value 0.34375 in the boxes below.
0.1011000 1111
e)Explain what overflow is and give an example of a situation which might cause overflow to occur?
When there is a number that is too big to be represented using given number of bits.
Q3) a) The binary pattern 1001 1000 0100 can be interpreted in a number of different ways?
Hexadecimal- BCD
Decimal- 9 8 4
Thursday, 13 October 2016
Tuesday, 11 October 2016
Floating Point Exam questions
Q1. A normalised floating point representation uses an 8-bit mantissa and a 4-bit exponent, both stored using 2's Complement format.
In binary write the smallest number that can be represented using this format.
Mantissa-0.1000000
Exponent-1000
B) This is a floating point representation of a number:
1.011000 0010
Calculate the denary equivalent of the number.
Answer= -2.5
C) Write the floating point representation of the denary number 12.75
0.1100110 0100
D) Floating point numbers are usually stored in normalised form.
State two advantages of using a normalised representation.
Advantage 1- It is a more precise way of representing values.
Advantage 2- Numbers take up less storage space so more can be stored.
An alternative twos's bit complement format representation is proposed. In the alternative representation 7 bits will be used to store the mantissa and 5 bits will be used to store the exponent.
Existing representation (8-bit mantissa, 4-bit exponent)
Proposed alternative (7-bit mantissa, 5-bit exponent)
Using a 7-bit mantissa and a 5-bit exponent will allow the decimal point to be moved farther allowing smaller, or larger numbers to be represented. However only having a 7-bit mantissa will restrict you on the accuracy of smaller numbers because there is less bits to work with. This means that some accuracy may be lost.
Using a 7-bit mantissa and a 5-bit exponent will allow the decimal point to be moved farther allowing smaller, or larger numbers to be represented. However only having a 7-bit mantissa will restrict you on the accuracy of smaller numbers because there is less bits to work with. This means that some accuracy may be lost.
Sunday, 9 October 2016
Floating Point Numbers
• What kind of rounding error can occur in Denary?
There is a problem with rounding when we have recurring numbers like 1/3. We have 0.333333333333...If we add 1/3+1/3+1/3 them we usually round it to 1. even though we know it is 0.99999999.• What kind of rounding error may happen in Binary?
In binary if you have a recurring number like 1/3 then the computer will eventually run out of bits to store the 1/3 so it will not truly be 1/3. this means there will be tiny errors in calculations where numbers cannot properly be represented and the computer has to round to give what is thinks is the correct answer.• Why use Floating Point?
We use Floating point because it is is much more efficient. This means it takes up less space to store the numbers and it is much easier for the computer to do calculations so it is much faster.• What is meant by the mantissa? What is meant by the exponent?
The first bit defines the non-zero part of the number and is called the Mantissa, the second part defines how many positions we want to move the decimal point, this is known as the Exponent and can be positive when moving the decimal point to the right and negative when moving to the left.
Both the mantissa and the exponent is in twos complement format. So if there is a 1 present in the leftmost bit of the mantissa, then this is a negative binary number.
• Can you convert the following 6 bit mantissa and 4 bit exponent into denary 0.10100 0100?
01010.0
=10,0
=10,0
Monday, 3 October 2016
Decimal Numbers in Binary
How to covert Decimal numbers such as 3.5, 6.625 or 0.25.
Set up the problem. For this example, let's convert the decimal number 15610 to binary. Write the decimal number as the dividend inside an upside-down "long division" symbol. Write the base of the destination system (in our case, "2" for binary) as the divisor outside the curve of the division symbol.
Divide. Write the integer answer (quotient) under the long division symbol, and write the remainder (0 or 1) to the right of the dividend.
Since we are dividing by 2, when the dividend is even the binary remainder will be 0, and when the dividend is odd the binary remainder will be 1.
Continue to divide until you reach 0. Continue downwards, dividing each new quotient by two and writing the remainders to the right of each dividend. Stop when the quotient is 0.
Write out binary number. Starting with the bottom remainder, read the sequence of remainders upwards to the top. For this example, you should have 10011100. This is the binary equivalent of the decimal number 156. Or, written with base subscripts: 15610 = 100111002
This method can be modified to convert from decimal to any base. The divisor is 2 because the desired destination is base 2 (binary).
IF Statements
Programs
don’t always run in SEQUENCE and require an element of SELECTION. SELECTION
means that part of the code may be executed depending upon a CONDITION being
met.
Conditions
are made up as follows:
Variable/Value Relational-Operator Variable/Value
Relational
Operators are as follows:
= Equal
To
< Less
Than
<= Less Than or Equal To
> Greater
Than
>= Greater Than or Equal To
<> Not Equal To
Statements Used
IF Condition Then
End IF
This is an example of the work from the Statements worksheet. It shows the use of IF and End |IF. A number is inputted and then the conditions that are met show up. so the number is between 1-20 for example.
Wednesday, 28 September 2016
Character Coding Exam questions
Question 1.
a) How many characters can be represented using ASCII? 128
b) How would the character E be represented using 7 bits? 1000101
c) Characters are transmitted using an e-bit code that includes a parity bit in the most significant bit?
D- 01000100
E- 11000101
H- 01001000
d) Parity works by either using odd or even parity. If there is an odd number of 1s in the end binary parity bit will be a 0. There are 1 bit and 3 bit parity. 1 bit is most common because it requires less data to be sent and is therefore cheaper to implement. At the receiving end, the code can be checked to see whether the number is still odd or even.
Question 2.
a) 53- 0110101
b)0110110
c) 9=57 0=48 difference is 9
d)1
e)3
f)The advantages of majority vote over parity bits is that the majority vote can repair the errors because the data is being sent multiple times where a parity bit can only detect that there is an error.
Character Codes Passport questions
1. What 3 different character systems exist and how many characters does each hold?
Ascii-128 characters, Extended Ascii-256 characters, Unicode-65,536 characters.
2. What are the decimal code equivalent of some letters in the alphabet? what are the Binary versions? a is 97 or 1100001. e is 101 1100101.
3. What are the differences with character codes of capital and lower case letter? They have a decimal difference of 32. The 32 bit is different. 0 is capital 1 is lower case.
4. What is meant by a parity bit? How does Parity work? what different parity systems are there? Parity bit is an extra bit on the end of the information to make sure it is correct and has not been changed. Parity works by either using odd or even parity. so if there is an odd or even number of 1 the end parity bit will be a 1 or 0. There are 1 bit and 3 bit parity. ! bit is most common because it requires less data to be sent and is therefore cheaper to implement.
5. What is meant by a check digit? How does this work? A check digit works by using the rest of the numbers then multiplying them and adding them. Then the check digit is the number between the total and the total rounded up to the nearest 10.
6. What is majority vote? How does it work? Majority vote is when the computer decides whether info is correct by what the majority of that bit is. so the info is sent 3 times and the majority of the 1s or 0s for that bit is what the computer assumes correct.
Ascii-128 characters, Extended Ascii-256 characters, Unicode-65,536 characters.
2. What are the decimal code equivalent of some letters in the alphabet? what are the Binary versions? a is 97 or 1100001. e is 101 1100101.
3. What are the differences with character codes of capital and lower case letter? They have a decimal difference of 32. The 32 bit is different. 0 is capital 1 is lower case.
4. What is meant by a parity bit? How does Parity work? what different parity systems are there? Parity bit is an extra bit on the end of the information to make sure it is correct and has not been changed. Parity works by either using odd or even parity. so if there is an odd or even number of 1 the end parity bit will be a 1 or 0. There are 1 bit and 3 bit parity. ! bit is most common because it requires less data to be sent and is therefore cheaper to implement.
5. What is meant by a check digit? How does this work? A check digit works by using the rest of the numbers then multiplying them and adding them. Then the check digit is the number between the total and the total rounded up to the nearest 10.
6. What is majority vote? How does it work? Majority vote is when the computer decides whether info is correct by what the majority of that bit is. so the info is sent 3 times and the majority of the 1s or 0s for that bit is what the computer assumes correct.
Subscribe to:
Posts (Atom)