Computer Platforms Computing Hardware and Software Von-Neuman architecture Early computers used to store the program and the data in separate areas of memory. This meant that if you had 64Kb of program area you could only write programs that were a maximum of 64Kb in length. The same problem occurred with data. If 64kb was allocated for data and only 24Kb were needed then the extra memory was wasted. Von-Neuman put forward the idea that both the program and the data could be stored in the same memory area. This overcame the problem of having a maximum program length. Long programs could be loaded but might restrict the amount of data. Short programs would allow more data to be loaded i.e. the use of memory became more flexible. Became of this flexibility Von-Neuman architecture became the normal model for all computers Bit and Bytes What is a Bit? Bit stands for Binary Digit A bit represents 2 states, which are usually represented as a 0 or a 1. Because a Bit can represent 2 states its number base is 2. A bit is the smallest way data can be represented in a computer. What is a Nibble? A Nibble is 4 Bits and can represent the binary numbers 0000 to 1111 and the hex numbers 0 to F (decimal 0 to 15). Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 1 of 25 Computer Platforms Computing Hardware and Software What is a Byte? A Byte is 8 Bits and can represent the binary numbers 00000000 to 11111111 and the hex numbers 00 to FF (0 to 255 decimal). What is a Word? A word is any collection of over 8 bits. Most words are prefixed with how many bits the word contains. i.e. 16 bit Word, 32 bit Word. Words are usually used to describe the width of data busses. Most words tend to be made up of 2 or more bytes. Common sizes When quoting bit and byte sizes in computing the following measures are used: Kilobyte or Kilobit = 1042 bytes or bits or 210 Megabyte or Kilobit = 1048576 bytes or bit or 220 Gigabyte or Gigabit = 1073741824 bytes or bits or 230 Most people tend to round these numbers down to: 1,000, 1,000,000 and 1,000,000,000 Number Systems and Data Representation Data Representation All data is represented in a computer system in binary. The main types of data that needs to be represented are Alphabetic (upper and lower case) Numeric (0 to 9) Special characters (question marks, comma, etc.) Control characters and codes All these data types are represented using codes such as ASCII, Unicode and BCD. American Standard code for Information Interchange (ASCII) ASCII is a 7-bit code that is used to represent characters. Bit 8 is used as a parity check the code was later extended to make an 8-bit code so that more characters could be represented. The code consists of: Control characters from 0 to 32 Symbols from 33 to 47and 58 to 64 Numbers from 48 to 57 Letters from 65 to 122 Symbols from 123 to 126 Delete. 127 Later the rest of the bits from 128 where used in the extended ASCII character set which uses 8 bits to represent extra characters. On of the problems with ASCII is that it can only be used to represent 256 codes and as computing became more international extra codes were needed to support other languages. Because of this reason ASCII is now being phased out and the new UNICODE standard is being adopted. Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 2 of 25 Computer Platforms Computing Hardware and Software Unicode This is the new International standard for representing characters Unicode is capable of representing all the symbols, characters and controls for the world. www.unicode.org . The main problem used to be that UNICODE uses 32 bits and many pieces of application software will only support 8-bit ASCII coding, To overcome this there are 3 different Unicode standards 8 bit 16 bit and 32 bit and most application software support these Unicode standards. Binary Coded Decimal BCD Binary Coded Decimal is used to input and output characters. It is not used for performing calculations. Its main use is in calculators. You can have 4 bit or 8 bit BCD whatever system is used you must show all the bits. In the examples below 25 cannot be written as 100101 it must be written as 00100101. Advantages of BCD are the coding does not involve the conversion of numbers to binary. Disadvantages Increases the length of the binary number and arithmetic is much more difficult. The following examples show 4 bit BCD where 4 binary digits are used for each number. BCD Examples Decimal 3 5 2 BCD 0011 0101 0010 Decimal 8 6 BCD 1000 0110 Decimal 7 1 4 BCD 0111 0001 0100 BIT Masks Bit masks are a way of representing data using individual bits in a byte or word. The data can then be searched using and logic / or logic to find matches. The reason they are used is they are very quick to search and a lot of data can be stored in a small amount of memory. Bit mask example Suppose that 8 pieces of information needed to be stored about a client. Lets say: 1. Gender 2. Car Owner 3. House-owner 4. Married 5. Has Garage 6. Pension 7. Employed 8. Life Insurance. Now these could be stored in 8 bits as follows 1. Gender 1 = Female 0 = Male 2. Car Owner 1 = Yes 0 = No 3. House-owner 1 = Yes 0 = No 4. Married 1 = Yes 0 = No 5. Has Garage 1 = Yes 0 = No 6. Pension 1 = Yes 0 = No Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 3 of 25 Computer Platforms Computing Hardware and Software 7. Employed 1 = Yes 0 = No 8. Life Insurance. 1 = Yes 0 = No Using the above a byte containing 11100011 would represent a female car owner with a pension, employed and has Life Insurance .The decimal number 227 could represent this. A bank of data can be quickly searched using AND. Looking at the above example if you were looking for Employed people with a Life insurance then the search criteria would be 11000000. When an AND is performed on the data using this criteria a match will be found 11100011 Record 11000000 Search AND 11000000 Match 10100011 Record 11000000 Search AND 10000000 No match More examples Bit masks only use the binary numbers that have a single 1 in. So in our case you can use the numbers 0001 0010 0100 and 1000. So with 4 bits you can represent 4 conditions. Here are the 4 conditions we are going to use. 0001 Read 0010 Write 0100 Add 1000 Delete Lets look at 4-person and give them some folder permissions. Joe can read from the folder only. Jill can read and write to the folder. Fred can read, write and add to the folder. Freda can do all read, write, add and delete Now to make a bit mask Joe Joe can read from the folder only. To convert this information into a Bit Mask you compare the information to the conditions. Read 0001 So his mask is 0001 Jill Jill can read and write to the folder only. To convert this information into a Bit Mask you compare the information to the conditions. Read 0001 Write 0010 So her mask is 0011 Fred Fred can read, write and add to the folder. To convert this information into a Bit Mask you compare the information to the conditions. Read 0001 Write 0010 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 4 of 25 Computer Platforms Computing Hardware and Software Add So his mask is 0100 0111 Freda Freda can do all read, write, add and delete. To convert this information into a Bit Mask you compare the information to the conditions. Read 0001 Write 0010 Add 0100 Delete 1000 So her mask is 1111 Searching Data Now lets assume that you wish to find who has permission to delete. Delete 1000 So the Search mask is 1000 Now this mask is compared to each person in the database using AND Person Person Mask Search Mask AND Result Joe 0001 1000 0000 Jill 0110 1000 0000 Fred 0111 1000 0000 Freda 1111 1000 1000 Match Another Search Who can add to a folder? Search mask will be 0100. Person Person Mask Search Mask AND Result Joe 0001 0100 0000 Jill 0011 0100 0000 Fred 0111 0100 0100 Match Freda 1111 0100 0100 Match Lets try a more sophisticated search Who can write AND add. This can be expressed as Person Mask AND (Write or Add) 0010 OR 0100 = 0110 So the Bit mask is Person Mask AND 0110 Person Person Mask Search Mask Result Joe 0001 0110 0000 Jill 0011 0110 0010 Fred 0111 0110 0110 Match Freda 1111 0110 0110 Match Bit Maps Bit maps are a method of storing graphic data. The most common file extension for a bit mapped file is BMP. The easiest way to see a bit mapped file is to open Microsoft Paint. Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 5 of 25 Computer Platforms Computing Hardware and Software There are other bit mapped graphic formats such as gif. The biggest disadvantage of bit mapped graphics is that the more detailed the picture the bigger the file size. The other disadvantage is that if a bit mapped image is resized then quality is lost. Number Systems All number systems have a base, symbols and place values. By using these any number system can be devised using a set of rules. When working in different number systems the base is always indicated in subscript next to the number i.e. 237810 Three number systems Decimal A number system based on 10 Binary A number system based on 2 Hexadecimal A number system based on 16 Binary base 2 We use 2 different symbols 01 When you have used the 2 symbols to indicate numbers larger than 1 the position of the symbol is important. These positions are decided by raising the base 2 by its place value. i.e. 23 22 21 20 (2 x 2 x 2) = 8 (2 x 2) = 4 (2 x 1) = 2 (2 x 0) = 1 So the decimal number 1310 is written as 23 22 8 4 1 1 21 2 0 20 1 1 When working in number systems this number is written as 11012 Denary or Decimal base 10 We use 10 different symbols 0123456789 To indicate numbers larger than 9 the position of the symbol is important. These positions are decided by raising the base 10 by its place value. i.e. 103 102 101 100 (10 x 10 x 10) = 1000 (10 x 10) = 100 (10 x 1) = 10 (10 x 0) = 1 So the number 2 thousand 3 hundred and seventy-eight (237810) is written as 103 102 101 100 1000 100 10 1 2 3 7 8 When working in number systems this number is written as 237810 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 6 of 25 Computer Platforms Computing Hardware and Software Hexadecimal base 16 We use 16 different symbols 0123456789ABCDEF When you have used the 16 symbols to indicate numbers larger than 15 the position of the symbol is important. These positions are decided by the base of 16 being raised by the power of its place value. 163 162 161 160 (16 x 16 x 16) = 4096 (16x16) = 256 (16 x 1) = 16 (16 x 0) = 1 So the decimal number 30010 is written as 163 162 4096 256 1 161 16 2 160 1 C When working in number systems this number is written as 12C16 Converting Between Number Systems Binary to Decimal Example 1 Write the binary number under the relevant columns. So the binary number 100110 would be converted by 1024 512 256 128 64 32 16 1 0 32 8 0 4 1 4 2 1 2 1 0 8 0 4 1 4 2 1 2 1 0 Answer = 32 + 4 + 2 = 3810 Example 2 So the binary number 110110 would be converted by 1024 512 256 128 64 32 16 1 1 32 16 Answer = 32+16 + 4+2 = 5410 Decimal to Binary Example 1 To demonstrate converting 4710 to binary 1 2 Divide 47 by 2 and put the answer underneath and the remainder alongside 23 remainder 1 Divide the answer 23 by 2 answer underneath and the remainder alongside 11 remainder 1 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Answer 47 23 23 11 Remain 1 1 Page 7 of 25 Computer Platforms Computing Hardware and Software 3 4 5 6 Divide the answer 11 by 2 and put the answer underneath and the remainder alongside 5 remainder 1 Divide the answer 05 by 2 and put the answer underneath and the remainder alongside 2 remainder 1 Divide the answer 02 by 2 and put the answer underneath and the remainder alongside 1 remainder 0 Divide the answer 01 by 2 and put the answer underneath and the remainder alongside 1 remainder 0 11 05 05 02 02 01 01 00 1 1 0 1 Read the columns upwards to get the answer is 4710 = 1011112 Example 2 To demonstrate converting 5410 to binary 1 2 3 4 5 6 Answer 45 27 28 13 13 06 06 03 03 01 01 00 Divide 54 by 2 and put the answer underneath and the remainder alongside 27 remainder 0 Divide the answer 27 by 2 answer underneath and the remainder alongside 13 remainder 1 Divide the answer 13 by 2 and put the answer underneath and the remainder alongside 6 remainder 1 Divide the answer 06 by 2 and put the answer underneath and the remainder alongside 3 remainder 0 Divide the answer 03 by 2 and put the answer underneath and the remainder alongside 1 remainder 1 Divide the answer 01 by 2 and put the answer underneath and the remainder alongside 1 remainder 1 Remain 0 1 1 0 1 1 Read the columns upwards to get the answer is 5410 = 1101102 Converting Hex to Decimal method 1 This is easier to do the long way round if you do not have a calculator. Step 1 Convert the hex number into groups of binary 3DEH Hex 3 D E Binary 0011 1101 1110 So 3DEH = 1111011110 binary Step 2 Convert binary to decimal 1024 512 256 128 1 1 1 512 256 128 64 1 64 32 0 16 1 16 8 1 8 4 1 4 2 1 2 1 0 Answer 512 + 256 + 128 + 64 + 16 + 8 + 4 + 2 = 99010 Step 1 Convert the hex number into groups of binary 5AFH Hex 5 A F Binary 0101 1010 1111 So 5AFH = 10110101111 binary Step 2 Convert binary to decimal Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 8 of 25 Computer Platforms Computing Hardware and Software 1024 1 1024 512 0 256 1 256 128 1 128 64 0 32 1 32 16 0 8 1 8 4 1 4 2 1 2 1 1 1 Answer 1024 + 256 + 128 + 32 + 8 + 4 + 2 +1= 145510 Converting Hex to Decimal method 2 Convert 4DDH to decimal Place Values for hexadecimal are 164 163 16 x 16 x 16 x 16 16 x 16 x16 162 16 x 16 4 4 x 16 x 16 1024 161 16 D 13 x 16 208 160 1 D 13 13 161 16 F 15 x 16 240 160 1 7 7 7 Answer 4DDH = 1024 + 208 + 13 = 124510 Convert D6F7H to decimal Place Values for hexadecimal are 164 163 16 x 16 x 16 x 16 16 x 16 x16 D 13 x 16 x 16 x16 53248 162 16 x 16 6 6 x 16 x 16 1536 Answer D6F7H = 53248 + 1536 + 240+7= 5503110 Example 1 To demonstrate converting 447710 to hex 1 2 3 4 Divide 4477 by 16 put the integer of the answer underneath and the remainder alongside 279.8125 remainder 0.8125 x 16 = 13 Divide the answer 279 by 16 put the integer of the answer underneath and the remainder alongside 17.4375 remainder 0.4375 x 16 = 7 Divide the answer 17 by 16 put the integer of the answer underneath and the remainder alongside 1.0625 remainder 0.0625 x 16 = 1 Divide the answer 01 by 16 put the integer of the answer underneath and the remainder alongside 0 remainder 1 Answer 4477 0279 Remain 13 in hex D 0279 0017 7 0017 0001 1 0001 0000 1 Answer Remain Read the columns upwards to get the answer is 447710 = 17DH Example 2 To demonstrate converting 124510 to hex Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 9 of 25 Computer Platforms Computing Hardware and Software 1 Divide 1245 by 16 put the integer of the answer underneath and the remainder alongside 77.8125 remainder 0 .8125.9375 * 16 = 13 2 Divide the answer 77 by 16 put the integer of the answer underneath and the remainder alongside 4.8125 remainder 0.8125 * 16 = 7 3 Divide the answer 4 by 16 put the integer of the answer underneath and the remainder alongside 0.25 remainder 0. 25 = 4 Read the columns upwards to get the answer is 124510 = 4DDH 1245 0077 0077 0004 0004 0000 13 in hex D 13 in hex D 4 Converting a decimal number to BCD Express 25 as a BCD 2 0010 5 0101 4 0100 7 1101 Answer 2510 = 00100101 Express 347 as a BCD 3 0011 Answer 34710 = 001101001101 Using calculator You can use the calculator supplied with Windows to perform conversions between Decimal, Hexadecimal and Binary. 1 Select, Programs, Accessories, Calculator 2 If needed Select View Scientific Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 10 of 25 Computer Platforms Computing Hardware and Software 3 Click the relevant radio button to select the mode of data entry in this example binary 4 Enter your data in this example 1101 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 11 of 25 Computer Platforms Computing Hardware and Software 5 Click the relevant radio button for your conversion in this example Dec Representing real numbers in binary Fixed Point Fixed-point numbers are used to provide fast calculations. The big disadvantage of fixed-point calculations is their inability to handle large numbers or small fractions. Addition or subtraction is easy with fixed-point numbers but multiplication or division are difficult. How do they work? To create fixed-point number a set number of bits is divided into 2 parts, one part to represent the integer (real component) and the other part to represent the fraction/decimal (rational component). Example Suppose an 8-bit Integer number was made into a fixed-point number then 1 way of splitting it would be Sign bit Real Decimal Rational 3 2 1 0 -1 2 2 2 2 2 2-2 8 4 2 1 0.5 0.25 1/2 ¼ 0 1 1 1 1 . 1 1 1 1 1 1 1 . 1 1 + 8 + 4 + 2 + 1 = 15 . 0.5 + 0.25 = 0.75 8 + 4 + 2 + 1 = 15 . 0.5 + 0.25 = 0.75 So the maximum number that could be represented with this arrangement is from + 15.75 to – 15.75 to an accuracy of 0.25 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 12 of 25 Computer Platforms Computing Hardware and Software Accuracy The more bits used the more accurate the number. Assume that 7 bits have been allocated to the rational part then the accuracy would be to 1/128. This leads to problems when fixed point numbers are used for calculations. 2-1 2-2 2-3 2-4 2-5 2-6 2-7 .5 .25 .125 .0625 0.03125 0.015625 0.0078125 ½ ¼ 1/8 1/16 1/32 1/64 1/128 Summary Fixed point numbers can not represent very large or very small number Fixed point numbers are not very accurate when used for calculations Floating Point Floating point numbers are used to represent real numbers to a high degree of accuracy. Fixed-point numbers have accuracy problems as they can only use a set number of digits to represent the decimal place. Floating point numbers overcome this by using scientific notation. Scientific notation uses a mantissa, a base number and an exponent. Here is the number 123.45678 in scientific notation 1.2345678 x 102 Here is the number 12345.678 in scientific notation 1.2345678 x 104 Here is the number 0.0012345678 in scientific notation 1.2345678 x 10-3 There are 2 types of floating point numbers single precision which use 32 bits and double precision which use 64 bits. Only single precision will be explained below. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 How do they work The decimal number is converted to binary (base 2) and stored in the computer in 3 parts: The sign The exponent The mantissa When 32 bits (single precision) are used to store a number the bits are allocated as shown below. The sign The exponent The mantissa There is 1 sign bit which is used to store if the number is positive (0) or negative (1) There are 7 exponent bits which can store a maximum number of 225 how this is used will be explained later. There 23 mantissa bits used to represent the fraction. Example For the purpose of this example how the decimal part of a real number is converted to binary will be omitted. Here is a real decimal number 3.6875 this would be represented as The integer 3 in binary is 11. The decimal 0.6875 in binary is 1011 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 13 of 25 Computer Platforms Computing Hardware and Software So the binary number would be 11.1011 This is then normalised which means move the decimal point to the left of the first 1 Normalised = 1.11011 x 21 Now the sign bit is easy it is 0 as the number is positive. The exponent is 127 + 1= 128 as the exponent is positive it is added to 127 The mantissa is 11011 the leading 1 is dropped, as it will always be there due to normalisation To see how this number would be stored look at the first row. For example 0.6875 in binary is 0.1011 when normalised is 1.011 x 2-1 The sign bit is 0 The exponent is worked out as 127 – 1 = 126 as a negative exponent is taken from 127 The mantissa is 011 the leading 1 is dropped, as it will always be there due to normalisation 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 To see how this number would be stored look at the second row 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Accuracy There are two levels of accuracy with floating point numbers single and double precision. Single precision numbers generally use 32 bits and double precision numbers use 64 bits. The more bits used the larger number that can be represented. The word precision is a little misleading, as it does not refer to the accuracy of the number just that double the number of bits used. You will come across single and double precision number in programming and the importance is the amount of space needed to store the number and the range of the number that can be stored. Numbers that fall outside these ranges will be subject to errors. Storage: Single 32 bits = 4 bytes Range: -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values Storage: Double 64 bits = 8 bytes Range: -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 14 of 25 Computer Platforms Computing Hardware and Software Converting Floating Point to Binary Well it works by using codes. So the first job is to calculate the code. Lets start with an easy example such as 8.5 Step 1 Get the sign bit. The sign bit is 0 as the number is positive. Step 2 Convert the decimal to binary Revision 27 26 25 24 23 22 21 20 2x2x2x2x 2x2x2 2x2x2x2x 2x2 2x2x2x2x 2 2x2x2x2 2x2x2 2x2 2 1 10000000 01000000 00100000 00010000 00001000 00000100 00000010 00000001 128 64 32 16 8 4 2 1 Now if we go the other way you get 2-1 2-2 2-3 2-4 2-5 ½ ¼ 1/8 1/16 1/32 2-6 2-7 1/64 1/128 .1 .01 .001 .0001 .00001 .000001 .0000001 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125 So 8.5 is 1000.1 Step 3 Get the exponent. You have to move the decimal place 3 places to the left to end up with 1.0001. So the exponent is 3. Now you have to add 127 to the 3 to make 130 which in binary is 10000010. Step 4 Deal with the mantissa. 1.0001 as the first 1 is implicit it is left off so the mantissa becomes 0001 Step 5 Make up the number Step 1 has the sign bit of 0 Step 3 has the exponent of 10000010 Step 4 has the mantissa of 0001 to which you have to add the remaining 0 to make the number of 0 to 23. So the final binary number for 8.5 decimal is: 01000001000010000000000000000000 Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 15 of 25 Computer Platforms Computing Hardware and Software Example 2 Here is another number -15.078125 Step 1 Get the sign bit. Negative is a 1 Step 2 Convert the decimal to binary 15.078125 15 is 8 + 4 + 2 + 1 which in binary is 1111 .078125 is 0.0625 + 0.015625, which in binary is .000101 So the complete binary number is 1111.000101 Step 3 Get the exponent. 1111.000101 so the exponent is 3 to make 1.111000101 Add 127 to make 130 which in binary is 10000010 Step 4 Deal with the mantissa. 1.111000101 is 11100010100000000000000 Step 5 Make up the number 11000001011100010100000000000000 To find out more Do a search on www.google.co.uk with the criteria “floating point binary”. This will bring up lots of hits relating to floating point numbers. Summary Floating point numbers are more accurate that fixed point Floating point numbers can represent very small values There are two floating-point numbers systems, single and double precision. Binary Mathematics Addition Adding binary is the same as adding in decimal but you cannot have any number greater than 1. So 1 + 0 = 1, 0 + 1 = 1, 1 + 1 = 0 carry 1 and 1 + 1+ 1 = 1 carry 1. Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 16 of 25 Computer Platforms Computing Hardware and Software Example 1 Add 01111 to 01010 (15 + 10) the red number is the carry Step 1 0 1 1 1 1 Step 2 0 1 0 1 0 1 0 0 1 1+0=1 1 + 1 = 10 1 1 0 1 1 0 1 0 1 1 Step 3 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 0 1 + 0 + 1 = 10 Step5 0 0 1 1 1+0+0=1 1 0 1 1 0 1 Example 2 Add 10111 to 01011 (23 + 11) Step 1 1 0 1 1 1 0 1 0 1 1 1 + 1 = 10 0 1 Step 3 1 0 0 1 1 1 1 1 1 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 0 1 + 0 + 1 = 10 Step5 1 + 0 + 1 = 10 Keyword D:\106735323.Doc 1 1 0 0 1 Step 4 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 + 1 + 1 = 11 Step 6 Answer Step 2 1 + 1 + 1 = 11 Step 4 1 0 1 + 1 + 0 = 10 Step 6 Answer 16/02/2016 Colin Chappell 1 Page 17 of 25 Computer Platforms Computing Hardware and Software Subtraction Subtraction is carried out using the 2's complement method. This is a mechanical process of inverting the negative number and adding 1 to the inverted number. Important Point Make sure you keep the numbers the same length. You should always end up with an extra number if you have carried out the process correctly. Example 1 0111 - 0100 (7 - 4) Invert the negative number 0 1 1 0 0 1 0 1 Now add the two numbers 0111 + 1100 Leave the spare 1 that 0 1 has fell off the end 1 1 1 0 0 Example 2 11010101 - 01100100 (213 - 100) Invert the 0 1 1 0 0 1 0 0 negative 1 0 0 1 1 0 1 1 number Add 1 to the inverted number 1 0 1 1 0 1 1 0 1 1 1 0 Answer = 0011 or 3 Add 1 to the inverted number 1 0 0 1 1 0 1 1 0 0 1 1 1 0 Now add the two numbers 11010101 - 10011100 Leave the spare 1 that 1 1 0 1 0 1 0 1 has fell off the end 1 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 1 Answer = 01110001 or 113 Use this spreadsheet program to help you understand and practise binary addition and subtraction. Multiplication and Division Microprocessors can only add so this is how the do multiplication and subtraction is used to carry out division. The process is a little more complicated than described below but the basic principle is the same. Multiplication Multiplication 5 x 4 means 4 groups of 5 it can be shown as 5 + 5 + 5 +5 so the microprocessor will perform 4 additions of 5 very quickly. Division Division is seeing how many times a number can be taken away from another number so 12 3 can be show as (12 - 3 = 9) (9 - 3 = 6) (6 - 3 = 3) (3 - 3 = 0) so the number 3 can be subtracted from the number 12 a total of 4 times. Hexadecimal Mathematics The microprocessor only carries out binary mathematics so all hexadecimal numbers are converted to binary first. To carry out hexadecimal mathematics yourself it is best to convert Keyword D:\106735323.Doc 16/02/2016 Colin Chappell 1 1 0 Page 18 of 25 1 1 0 Computer Platforms Computing Hardware and Software the hexadecimal numbers to decimal and then carry out the calculation. Once the answer has been obtained convert the answer from decimal to hexadecimal. What is important is that you check your answers. Another way is to use binary groups of 4. This can be easy if you can remember the binary number sequence 0 to 15. Decimal Hex Binary 0 0 0000 1 1 0001 2 2 0010 3 3 0011 4 4 0100 5 5 0101 6 6 0110 7 7 0111 8 8 1000 9 9 1001 10 A 1010 11 B 1011 12 C 1100 13 D 1101 14 E 1110 15 F 1111 Addition Hex Add right Convert to decimal Convert right answer Answer Keyword D:\106735323.Doc A4 A+5 10 + 5 = 15 15 = F FF + + 5B Add left Convert to decimal Convert left answer 16/02/2016 Colin Chappell FF 4+B 4 + 11 = 15 15 = F Page 19 of 25 Computer Platforms Computing Hardware and Software Syllabuses Unit 02: Computer Systems Learning hours: 60 NQF level 3: BTEC National Description of unit This unit outlines the fundamental way in which a computer works, starting with simple logic and progressing to a simple model of a microprocessor. This is followed by an overview of computer hardware and peripherals to enable learners to understand the way in which computer systems are constructed and how they work. The unit also covers a basic knowledge of the purpose of operating systems, some elementary operating system processes and elementary low-level programming. The unit is intended as an introduction to a broad range of important computing concepts, and consequently it is not necessary to deliver the content in great depth. Other units (in particular Unit 23: Computer Hardware and Unit 19: Multimedia Technology) are intended to explore some of the topics in this unit in much greater depth. This unit presents opportunities to demonstrate key skills in application of number and communication. This unit presents opportunities to demonstrate key skills in application of number and communication. Summary of learning outcomes To achieve this unit a learner must: 1 Describe the internal operations of a model microprocessor 2 Demonstrate a thorough knowledge of modern computer systems hardware 3 Write simple low level programs 4 Install and use a modern operating system. 1 Internal operations Data representation: number system conversions, eg binary, denary, hexadecimal, floating point numbers, ASCII, bit masks, graphic bitmaps, role of different number systems; demonstration of the possibility of errors by inappropriate representation of decimal or other numbers in various binary forms Logic and fetch-execute cycle: concepts of logic and logic gates, simple arrays of logic gates, truth tables, concepts of registers, buses, control unit, arithmetic and logic unit, memory, clock and control signals in a model microprocessor and the fetch-decode-execute cycle, without reference to performance enhancing hardware such as cache memory 2 Computer systems hardware Computer selection and design: analyse user needs and select hardware matched to a machine specification Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 20 of 25 Computer Platforms Computing Hardware and Software PC build: build and configure a PC to specification using appropriate safety and ESD precautions as appropriate Maintenance: maintain software and hardware using appropriate disk tools Troubleshooting: locate and repair faults using appropriate faultfinding techniques 3 Low level programs Machine and assembly language programming: design simple machine and/or assembly language programs to use data transfer, arithmetic and jump and branch instructions. 4 Operating system Operating system functions: overview of functions, eg user interface, machine and peripheral management, etc; comparison between functions of different types of operating system (personal computer, network, mainframe, etc). Operating system installation: install operating system, eg Windows (modern versions), Linux, AppleMacOS. Computer operations: use of a proprietary operating system, generation of environment and systems for a computer user (file/directory structures, tailoring of screen interface, backup systems, etc). In order to pass this unit, the evidence that the learner presents for assessment needs to demonstrate that they can meet all of the learning outcomes for the unit. The criteria for a pass grade describe the level of achievement required to pass this unit. Grading criteria To achieve a pass grade the evidence must show that the learner is able to: 1. 2. 3. 4. 5. 6. 7. State the basic concepts and principles involved in the representation of data (including numeric, ASCII, bit masks and bit maps) within a computer system Specify and select components, and build, conforming to safety standards, a PC to meet a technical specification Install and configure an operating system and software to meet a client specification Convert numbers between binary, denary and hexadecimal notation Add, subtract, multiply and divide numbers held in different formats including floating point Write very basic program functions (such as fetching and adding together two numbers, and storing the result) in a low level language Check the accuracy of own work and eliminate obvious errors. To achieve a merit grade the evidence must show that the learner is able to: 1. 2. 3. Understand the concepts and principles involved in the representation of data within a computer system, the role played by each format and the possible errors caused by inappropriate use of format Describe, with the aid of diagrams, the hardware (including logic gates, registers, buses, CU, ALU and memory) and its function within a model microprocessor Describe the functions of an operating system within a modern computer system Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 21 of 25 Computer Platforms Computing Hardware and Software 4. Design and write programs in a low level programming language which include data transfer, arithmetic, jump and branch instructions. To achieve a distinction grade the evidence must show that the learner is able to: 1. 2. 3. Describe in detail the function of the fetch- decode-execute cycle and its relationship to the workings of a microprocessor, making detailed reference to the role played by hardware and software in this relationship Evaluate the work done in building and configuring a computer system to a given specification including how well the finished system met the specification, what went well and what went less well in the work and what improvements could be made to the resulting system Write coherently and comprehensively, including accurate drawings, which enhance the text and show a good command of technical language. Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 22 of 25 Computer Platforms Computing Hardware and Software Higher Nationals Unit 1: Computer Platforms Learning hours: 60 NQF level 4: BTEC Higher National — H1 Description of unit This unit is aimed at IT practitioners who need sufficient knowledge of computer architecture to make rational and commercial decisions on the selection and specification of systems. Learners will learn how to evaluate operating systems in order to create their own operating environment. Many IT practitioners communicate with specialist technical support staff during the specification and planning of systems implementation. This unit aims to give learners the confidence to communicate with technical and non-technical specialists to justify their recommendations. It is expected that centres will use current personal computer and networking resources. Learners should be encouraged to read current journals to investigate and evaluate new hardware and software developments. Summary of learning outcomes To achieve this unit a learner must: 1 Investigate computer systems 2 Investigate operating systems 3 Design a computer system 4 Test your computer system. 1 Computer systems Processor: description of components (Von-Neuman architecture), terminology (eg bits, bytes, kilobytes etc), identification of factors affecting performance (eg millions of instructions per second (MIPS), floating point operations per second (FLOPS), clock speed, computed performance indexes, bus architectures, pipelining) Backing store: identification of types (disc, CD, CD-R, CD-RW, DVD-RW, DVD-RAM etc), performance factors (eg data transfer rate, seek times, capacity) Peripherals: description of available peripherals (displays, printers etc), understanding of performance factors (eg displays — performance, resolution, colour depth, video RAM, refresh rate, interlacing, slot pitch, etc, printer — speed, resolution, image quality, software requirements, postscript, PCL and associated printer control) Computer selection: specification of requirements, performance of the selected system, costs, user benefits 2 Operating systems Operating system functions: overview of functions (eg user interface, machine and peripheral management etc), comparison between functions of different types of operating system (personal computer, network, mainframe etc) Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 23 of 25 Computer Platforms Computing Hardware and Software Computer operations: proprietary operating systems, creation of environment and systems for a computer user (file/directory structures, tailoring of screen interface, backup systems etc), user profile 3 Design a computer system Selection: processor (eg speed, special characteristics), memory, storage devices, display, peripherals, specialised components (eg sound cards, video cards, datalogging interfaces), bus system, network readiness/adaptability User needs: costs, productivity, particular requirements (eg power, display, special needs), training needs 4 Test your computer system Test plan: software testing (eg: black box, white box), hardware testing methodologies, documentation, health and safety issues (eg compliance) User support planning: identifying user training needs, producing a training schedule, functions of a help desk/help line/help software. Security: physical and logical security measures, backup and recovery, hacking, encryption, levels of access rights Outcomes Assessment criteria for pass To achieve each outcome a learner must demonstrate the ability to: 1 Investigate computer systems Select machine components or sub-systems appropriate to given tasks Evaluate the performance of the selected system 2 Investigate operating systems Contrast the functions and features of different types of operating systems Understand how to customise operating systems 3 Design a computer system Investigate and identify the key components for a computer system for a particular user Specify a complete computer system to suit a given task 4 Test a computer system Produce a plan that checks the main hardware and software components, using standard techniques Produce user documentation for your system Produce a security policy for your system. Demonstrate that the system meets health and safety requirements Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 24 of 25 Computer Platforms Computing Hardware and Software Useful Web Addresses http://www.ieee.org/portal/site Keyword D:\106735323.Doc 16/02/2016 Colin Chappell Page 25 of 25