Describe How Data Are Stored and ... - INFOTECH 100



Describe How Data Are Stored and Manipulated Within the Computer BinaryComputer systems manipulate numbers. Inside the computer, the numbers are represented as bits or bytes that represent words.For example, the number three is represented by a byte with bits 0 and 1 set; 00000011. This is numbering system using base 2. People commonly use a decimal or Base 10 numbering system. What this means is that in Base 10, count from 0 to 9 before adding another digit. The number 22 in Base 10 means we have 2 sets of 10's and 2 sets of 1's.Base 2?is also known as?binary?since there can only be two values for a specific digit; either a 0 = OFF or a 1 = ON. You cannot have a number represented as 22 in binary notation. The decimal number 22 is represented in binary as 00010110 which by following the below chart breaks down to:Bit Position76543210?11111111Decimal128643216842122 or 00010110:All numbers representing 0 are not counted,?128, 64, 32, 8, 1?because 0 represents OFFHowever, numbers representing 1 are counted,?16 + 4 + 2?= 22 because 1 represents ONDecimal Values and Binary Equivalents chartDecimalBinary11210311410051016110711181000910011010101610000321000006410000001001100100256100000000512100000000010001111101000102410000000000?1. A?base 2?number system that uses 8-bits has each represented by the numeric values of 0 or 1, also known as ON or OFF, UP or DOWN, and is the primary language that computers use to communicate.Below is an example of the maximum 8-bit value of 255, which is 11111111 in?binary.To get this value add each column, so 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255.Value:1286432168421ON/OFF:11111111Tip:?Counting on a computer normally start with 0, instead of 1. Therefore, counting all the bits does equal 255, however, if you start at 0, it is really 256.Below is another example of 10001101, which is 141 or 1 + 4 + 8 + 128.Value:1286432168421ON/OFF:10001101Real NumbersThere are two types of real numbers, Fixed-Point and Floating Point.Fixed PointFixed point data items are numbers which have embedded decimal point i.e. 1.5,458.4589, -0.569.Floating PointFloating point data items are numbers, which are, held as binary fractions by a computer.The numbers are expressed in a form where you have a mantissa and an exponent. The exponent indicates how many digits the decimal point should move. For example an exponent of 2 indicates that you move the decimal point to the right by two places to get the original number 12.3. Then, an exponent of -3 would take the decimal point to the left by three places to again, obtain the 0.000123.Note that we are not changing the original number, only representing it in a different form so that it can be stored in the computer.?Number?Mantissa?Exponent12.3 =?0.123 * 1020.123?2123000 =?0.123 * 1060.123?60.000123 =0.123 * 10-3?0.123?-3?Signs and Magnitude in BinaryNegative signs are not used in binary however the bit zero (0) at the furthest left is used to indicate that a number is positive. While a 1 placed at the furthest left of a note indicates that the number is negative. For example:001011012 is positive101011012 is negativeIf you are given a four bit number example such as 10012 and you are asked to represent it as an 8 bit negative binary number, you can add zeroes as a place filler to the left then a 1 at the on the eighth until you have bits in total. For example 10012 as an eighth bit negative number is 100010012. 10012 displayed as a positive number 000010012. 000010012= 910100010012 = -910Binary Coded Decimal (BCD).This is a method used to represent decimal numbers in a simpler way. If you were to convert 25010 to binary you would normally have to divide it by 2 and record the remainders. However using Binary Coded Decimal (BCD), each digit is represented in binary by a 4-bit binary code.Digit (Base 10)Binary code00000100012001030011401005010160110701118100091001Therefore 25010 can be represented as25000100101000025010 = 0010010100002We can take this a little further.1010 = Positive sign (+)1011 = Negative sign (-)Therefore 250 represented in BCD is 1010 0010 0101 0000 + 2 5 0And-250 represented in BCD is 1011 0010 0101 0000 - 2 5 0OctalA?base-8?number system commonly used to represent binary numbers and other numbers in a shorter form. Below is a basic chart of how a binary number comprising 8 bits is converted to an octal number.Binary11111111Octal+200+100+40+20+10+4+2+1Below are some binary examples and their octal equivalents.10001111 =200 + 0 + 0 + 0 + 10 + 4 + 2 + 1 =?21710101111 =200 + 0 + 40 + 0 +?10 + 4 + 2 + 1 =?257Can you calculate 11010100 to be 324?Hexadecimal numbering systemThe other major numbering system used by computers is?hexadecimal, or Base 16. In this system, the numbers are counted from 0 to 9, then letters A to F before adding another digit. The letter A through F represent decimal?numbers 10 through 15, respectively.The chart?below?indicates the values of the hexadecimal position compared to 16 raised to a power and decimal values. It is much easier to work with large numbers using hexadecimal values than decimal.To convert a value from hexadecimal to binary, you merely translate each hexadecimal digit into its 4-bit binary equivalent. Hexadecimal numbers have either and?0x?prefix or an?h?suffix. For example, the hexadecimal number:0x3F7ATranslates into, Using the Binary chart and the below chart for Hex:0011 1111 0111 1010DecimalHexadecimalBinary00000011000122001033001144010055010166011077011188100099100110A101011B101112C110013D110114E111015F11111. Alternatively referred to as?Base 16?and?hex, the?hexadecimal numbering system?uses combinations of 16 digits and characters (letters)?to represent all numerical values. In addition to the ten numbers in the decimal system (0, 1, 2, 3, 4, 5, 6, 7, 8 and 9), hexadecimal also uses the letters A through F to create a hexadecimal number.For example, "computer hope" in hexadecimal becomes "636f6d707574657220686f7065".Anyone who has designed a web page has encountered?hexadecimal value?when doing colors. For example, to create red text use the HTML?color code?#FF0000, which translates to 255 Red, 0 Green, and 0 Blue in hexadecimal.Ones complementTo convert a number using the ones complement, simply change the 0s to 1s and the 1s to 0s. So the ones complement of 111010112 is 000101002. Also the ones complement of 000101002 is 111010112. Two’s complementThis is another method for representing signed integers. Steps Write the integer in its sign and magnitude formFlip the bits, i.e. change all 1’s to 0’s to 1’sAdd a bit 1 to this numberExample Write the following decimal integers two’s complement representation using 8 – bit store:9-9Solution0000 0110 sign and magnitude form1111 0110 flip the bitsAns 1111 0111 add bit 11000 1001 sign and magnitude0111 0110 flip the bitsAns 0111 0111 add bit 1ASCII codes (American Standard Code for Information Interchange)So far we have been using binary to represent numbers. ASCII codes is used to represent number, symbols as well as things as DELETE, BACKSPACE, etc. Basic concept of the ASCIIEach code takes up 1 byte (8bits)Capital letters are represented with the binary digits for:65 – 90Lower case letters by the binary digits for:97 – 122The digits 0 – 9 by the binary digits for:49 – 57ExampleThe Ascii code for D is 010001002. What is the binary code for W?D is the 4th letter of the alphabet while W is the 23rd . 23 – 4 = 19. We should therefore add the binary equivalent 19 to the ASCII code of D.Thus:binary code for D 01000100Binary code for 19+00010011 01010111The ASCII code for W is 010101112 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download