Produce a leaflet for a trainee programmer which explains the following:
Why the knowledge of the binary numbering system is essential * The binary numbering system plays a central role in how information of all kinds is stored on the computer. Understanding binary can lift a lot of the mysteries from computers because at a fundamental level they're really just machines for flipping binary digits on and off. There are several activities on binary numbers in this document, all simple enough that they can be used to teach the binary system to anyone who can count! Generally children learn the binary system very quickly using this approach, but we find that many adults are also excited when they finally understand what bits …show more content…
and bytes really are. * How binary numbers can represent decimal numbers * In mathematics and computer science, the binary numeral system, or base 2, represents numeric values using two digits 0 and 1. The 0 and 1 is the off and on states of the switches with 0 being the off state. Because of its straightforward implementations in electronic circuitry using logic gates the binary system is used internally by all modern computers and computer based devices like mobile phones. Any number can be represented by a sequence of bits (binary digits), which in turn may be represented by any mechanism capable of being in two mutually exclusive states. The following sequence of 1s and 0s is interpreted as the binary numeric value of 667: 1 0 1 0 0 1 1 0 1 1. The numeric value represented in each case is dependent upon the value assigned to each symbol. In a computer, the numeric values may be represented by two different voltages; on a magnetic disk, magnetic polarities may be used. A "positive", "yes", or "on" state is not necessarily equivalent to the numerical value of one; it depends on the architecture in use. * Why hexadecimal is a useful numbering system * A big problem with the binary system is verbosity. To represent the value 202 requires eight binary digits. The decimal version requires only three decimal digits and, thus, represents numbers much more compactly than does the binary numbering system. This fact was not lost on the engineers who designed binary computer systems. When dealing with large values, binary numbers quickly become too unwieldy. The hexadecimal (base 16) numbering system solves these problems. Hexadecimal numbers offer the two features: * hex numbers are very compact * It is easy to convert from hex to binary and binary to hex. * The Hexadecimal system is based on the binary system using a Nibble or 4-bit boundary. In Assembly Language programming, most assemblers require the first digit of a hexadecimal number to be 0, and place an "h" at the end of the number to denote the number base. * How text can be represented in a computer system * The ASCII text-encoding standard uses 128 unique values (0–127) to represent the alphabetic, numeric, and punctuation characters commonly used in English, plus a selection of control codes which do not represent printable characters.
For example, the capital letter A is ASCII character 65, the numeral 2 is ASCII 50, the character} is ASCII 125 and the metacharacter carriage return is ASCII 13. Systems based on ASCII use seven bits to represent these values digitally. In contrast, most computers store data in memory organized in eight-bit bytes. Files that contain machine-executable code and non-textual data typically contain all 256 possible eight-bit byte values. Many computer programs came to rely on this distinction between seven-bit text and eight-bit binary data, and would not function properly if non-ASCII characters appeared in data that was expected to include only ASCII text. For example, if the value of the eighth bit is not preserved, the program might interpret a byte value above 127 as a flag telling it to perform some function. It is often desirable, however, to be able to send non-textual data through text-based systems, such as when one might attach an image file to an e-mail message. To accomplish this, the data is encoded in some way, such that eight-bit data is encoded into seven-bit ASCII characters (generally using only alphanumeric and punctuation characters—the ASCII printable characters). Upon safe arrival at its destination, it is then …show more content…
decoded back to its eight-bit form. This process is referred to as binary to text encoding. Many programs perform this conversion to allow for data-transport, such as PGP and GNU Privacy Guard (GPG).
Write no more than one side for each item above and make sure you provide examples to explain each item
Task 2 (P2)
List the various ways in which a sequence of bits might be used to represent data in a computer system. For each one gives a brief (one or two paragraph) explanation of how the data can be converted into binary and if there is any quality issues.
Hexadecimal can be used to represent colour on the pc
Task 3 (P3)
For each of the following items you must show each step of your working and explain what you did.
(Do not just look up the value in a table or use a calculator) | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Binary | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | Hexadecimal | 5 | 3 |
1. Convert 99 decimal, first to binary and then to hexadecimal
2. Convert 99 hexadecimal, first to binary and then to decimal | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Binary | 9 | 9 | Hexadecimal | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 |
3. Add 48 decimal to 51 decimal using the binary arithmetic; Give the answer in decimal. | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 48 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 51 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 99 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 |
4. Subtract 99 decimal from 48 decimal using the two’s complement method | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 48 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 99 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 |
5. Convert 32 decimal to binary floating point. Use a 6 bit mantissa and a 4 bit exponent. | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
| 32 binary | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | | | | | | 0.5 | 0.25 | 0.125 | 0.0625 | 0.03125 | 0.015625 | | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Mantissa= 0.5 Exponent= 0
Task 4 (P4)
· Draw the diagram, using logic gates, of a half adder. INPUTS | OUTPUTS | A | B | SUM | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
S
B
A
C
This, gives a true output if one and only one of the inputs is true (1). If both inputs are false (0) then it gives a false, and if both inputs are true then it gives a false (0). A way to remember XOR is "one or the other but not both".
INPUTS | OUTPUTS | A | B | CARRY | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | INPUTS | OUTPUTS | A | B | CARRY | SUM | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |
With the AND gate you can only get a true if both the values are true. All out puts are 0s unless the inputs are both 1s.
The problem with the half adder is that it doesn’t complete the addition of the values and you are left with a carry and an unfinished answer. But if you add another XOR gate then have the sum from the previous XOR gate go through the second XOR gate and then have the AND gate carry go through the XOR gate there by adding the carry to the sum and giving you a complete answer.
INPUTS | OUTPUTS | A | B | CARRYIN | CARRYOUT | SUM | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 |
· For each logic gate you use, describe its operation and provide a truth table.
· Create a truth table for the half adder and explain how it can be used in binary addition.
· Describe what the problem is with a half adder and how it can be modified to perform full binary addition. Draw the logic gates and create a truth table for your solution.
Task 5 (M1)
Add an extra page to the leaflet you produced in task 1. On this page you must: 1. Explain, using examples, how decimal numbers can be represented in standard form a. Standard form is a way of writing down very large or very small numbers easily. 103 = 1000, so 4 × 103 = 4000. So 4000 can be written as 4 × 10³. This idea can be used to write even larger numbers down easily in standard form. b. Small numbers can also be written in standard form. However, instead of the index being positive (in the above example, the index was 3), it will be negative. c. The rules when writing a number in standard form is that first you write down a number between 1 and 10, and then you write × 10(to the power of a number). d. Example e. Write 81 900 000 000 000 in standard form: 81 900 000 000 000 = 8.19 × 1013 f. It’s 1013 because the decimal point has been moved 13 places to the left to get the number to be 8.19 g. Example h. Write 0.000 001 2 in standard form: 0.000 001 2 = 1.2 × 10-6 i. It’s 10-6 because the decimal point has been moved 6 places to the right to get the number to be 1.2 j. On a calculator, you usually enter a number in standard form as follows: Type in the first number (the one between 1 and 10). Press EXP. Type in the power to which the 10 is risen. k. 2. Show how decimal numbers can be represented in floating point binary l.
3. Explain the benefits of using standard form and floating point representations.
4. Describe how floating point is implemented in 32 and 64 bit processors.