Menu

Binary 10011

4 Comments

Almost without fail, numbers are represented binary two voltage levels which can represent a one or a zero an interesting exception to this rule is the new memory device recently announced by Intel which uses one of four possible voltage levels, thereby increasing the amount of information that can be stored in a given space. The number system based on ones and zeroes is called the bi nary system because there are only two possible digits. Before discussing the binary system, a review of the dec imal ten possible digits system is in order, because many of the concepts of the binary system will be easier to understand when introduced alongside their decimal counterpart. You should all have some familiarity with the decimal system. For instance, to represent the positive integer one hundred and twenty-five as a decimal number, we can write with the postivie sign implied. Each binary to the left has a multiplier 10011 is 10 times the previous digit. Hopefully this 10011 all a review. Some observations To multiply a number by 10 you can simply shift it to the left by one digit, and fill in the rightmost digit with a 0 moving the binary place one to the right. To divide a number by 10, simply shift the number to the right by one digit moving the decimal place one to the left To see how many digits a number needs, you can simply take the logarithm base of the absolute value of the number, and add 1 to it. The integer part of the result is the number of digits. Binary representations of positive can be 10011 in the same way as their decimal counterparts. Each digit in a binary number is called a bit. The number is represented by 10011 bits. Any number can be broken down this way, by finding all of the powers of 2 that add up to the number in question in this case, and You can see binary is exactly analagous to the decimal deconstruction of the number that was done earlier. Likewise we can make a similar set of observations To multiply a number by 2 you can simply shift it to the left by one digit, and fill in the rightmost digit with a 0. To divide a number by 2, simply shift the number to the right by one digit To see how many digits a number needs, you can simply take the logarithm base 2 of the number, and add 1 to it. What is the largest number that can be represented by an unsigned integer? The most common grouping is 8 bits, which forms a byte. A single byte can represent numbers. Memory capacity is usually referred to in bytes. Two bytes is usually called a word, or short word though word-length depends on the application. A two-byte word is also the size that is usually used to represent integers in programming languages. A long word is usually twice as long as a word. A less common unit is the nibble which is 4 bits, or half of a byte. It is cumbersome for humans to deal with writing, reading and remembering individual bits, because it takes many of them to represent even fairly small numbers. A number of different ways have been developed to make the handling of binary data easier for us. The most common is hexadecimal. In hexadecimal notation, 4 bits a nibble are represented by a single digit. There is obviously a problem with this since 4 bits gives 16 possible combinations, and there are only 10 unique decimal digits, 0 to 9. This is solved by using the first 6 letters A. F of the alphabet as numbers. The table shows the relationship between decimal, hexadecimal and binary. Clearly hexadecimal is better suited to the task of representing binary numbers than is decimal. It is much less common binary but is still used occasionally e. Answer It was noted previously that we will not be using a minus sign to represent negative numbers. We would like to represent our binary numbers with only two symbols, and 1. There are a few ways to represent negative 10011 numbers. To represent an n bit signed binary number the leftmost bit, has a special significance. The difference between a signed and an unsigned number is given in the table below for an 8 bit number. If Binary 7 is not set as in the first example the representation of signed and unsigned numbers is the same. However, when Bit 7 is set, the number is always negative. For this reason Bit 7 is sometimes called the sign bit. Signed 10011 are added in the same way as unsigned numbers, the only difference is in the way they are interpreted. This is important for designers of arithmetic circuitry because it means that numbers can be added by the same circuitry regardless of whether or not they are signed. If we want to know what what number is represented bywe apply the procedure again? What is the largest positive number that can be represented? In the 320C50 Digital Signal Processor, this typically occurs when moving a number from a 16 bit register to a 32 bit register. Whether or not sign-extension is applied during such a move is determined by the sign-extension mode bit. Note that to store a 32 bit number in 16 bits you can simply truncate the upper 16 bits as long as they are all the same as the left-most bit in the resulting 16 bit number - i. Most processors even have two separate instructions for shifting numbers to the right which, 10011 will recall, is equivalent to dividing the number in half. The first instruction is something like LSR Logical Shift Right which simply shifts the bits to the right and usually fills a zero in as the lefmost bit. The second instruction is something like ASR Arithmetic Shift Rightwhich shifts all of the bits to the right, while keeping the leftmost bit unchanged. With ASR becomes Of course, there is only one instruction for a left shift since LSL is equivalent to ASL. The representation of unsigned binary fractions proceeds in exactly the same way as decimal fractions. Though it is possible to represent numbers greater than one by having digits to the left of the decimal place we will restrict ourselves binary numbers less than one. These are commonly used by Digital Signal Processors. The largest number that can be represented by such a representation is mthe smallest number is m For a fraction with 15 bits of resolution this gives a range of approximately to E-5. Note that this representationis easily extended to represent all positive numbers by having the digits to the left of the decimal point represent the integer part, and the digits to the right representing the fractional part. Thus Exercises Convert from binary to decimal Answer Convert from binary to decimal Answer Convert from decimal to a binary fraction Answer Convert from decimal to a binary fraction Answer Approximate as a binary fraction use 8 10011 Answer Signed binary fractions Signed binary fractions are formed much like signed integers. If this bit is set, the number is negative, otherwise the number is positive. The largest positive number that can be represented is still m but the largest negative number is The resolution is still m There is a terminology for naming the resolution of signed fractions. If there are m bits to the right of the decimal point, the number is said to be in Q m format. Another way to convert Q m numbers to decimal is to represent the binary number as a signed integer, and to divide by 2 m. To convert a decimal number to Q mmultiply the number by 2 m and take the rightmost m digits. Note, this simply truncates the number; it is more elegant, and accurate, but slightly more complicated, to round the number Comments or Questions? Multiply by to get This is represented in binary asso the Q7 representation is This agrees with the result of the previous exercise Binary Binary Fractions.

Binary Part 1: Converting Binary to Decimal (Open)

Binary Part 1: Converting Binary to Decimal (Open)

4 thoughts on “Binary 10011”

  1. Alboy says:

    Savings Arrangements Established by States for Non-Governmental Employees.

  2. amigo_76 says:

    The door opened then--opened as suddenly as if it were on a spring--and Rainsford stood blinking in the river of glaring gold light that poured out.

  3. adaltvideo says:

    The power relationship distinctly favours the English, who are held in high regard by the Japanese as civilized human beings in kind, not rude characterizations.

  4. anger82 says:

    Known as sleeping sickness in the United States, this disease killed one-third of its victims and led to post-encephalitic parkinsonism in many others.

Leave a Reply

Your email address will not be published. Required fields are marked *

inserted by FC2 system