Hexadecimal Division and AdditionDate: 07/06/2003 at 21:44:26 From: Manny Subject: Hexadecimal Division and Addition I have searched your archives for examples of hexadecimal addition and division, but the examples I found were for subtraction and multiplication. Could you provide a few examples of how to solve addition and division problems? For the division problems, I'd really appreciate two examples, one where the answer is less than one and one where the answer is greater than 1. Thank you. Date: 07/08/2003 at 03:01:25 From: Doctor Mike Subject: Re: Hexadecimal Division and Addition Hi Manny, I suppose you mean "long division" in hex. If not, let me know. The short answer is that you do it EXACTLY the same as in base ten, but do all the multiplication and subtraction steps completely in hex. This is hard, because you probably have not memorized your hex multiplication tables. Let's quickly review long division in base ten with an example. Say you want to divide 12 into 2526. Your work would look like: 2 1 0 R6 --------- 1 2 / 2 5 2 6 2 4 ---- 1 2 1 2 ---- 0 6 You would describe this in words like this. 12 goes into 25 twice, so you write 2 on top (in the quotient) and write 2 times 12 or 24 below. 25 minus 24 is 1, and bring down the 2, to get 12. Write 1 on top and write 1 times 12 below. Subtract 12 from 12 and write the result, 0. Bringing down the 6, we see 12 will not go into it at all, so write 0 in the quotient, and note a remainder of 6. [This should all be very familiar.] Now consider a simple hex problem. This problem, stated in base ten, is 9632 divided by 18. When you translate those numbers into hex, it comes out as 25A0 divided by 12. 2 1 7 R2 -------- 1 2 / 2 5 A 0 2 4 ---- 1 A 1 2 ---- 8 0 7 E ---- 2 You describe this in words like this (remember ALL numbers here are hex numbers). 12 goes into 25 twice. Write 2 in the quotient and 2 times 12 below. Subtract 24 from 25 and get 1, which you write below. Bring down the A. 12 goes only once into 1A, so write 1 in the quotient and write 12 below. Subtract 12 from 1A to get 8, which you write down below. Bring down the 0. 12 goes 7 times into 80. Write 7 in the quotient, and multiply 7 times 12, or 7E, below the 80. Subtract 7E from 80, getting 2. So we have a remainder of 2. Note: Most multiplication "facts" you know from base ten, like 7 times 12 = 84, are wrong in hex. Why? Because if you multiply 7 hex by 12 hex, you are really doing a multiplication that we would describe as 7 times 18 if we were in base ten. Here is a division for a fraction less than 1, as you asked. What is the quotient of 1 divided by 3? 0. 5 5 5 5 ...... ------------ 3 / 1. 0 0 0 0 ...... F ---- 1 0 F --- 1 0 F --- 1 0 etc. Clearly, this repeats forever, and shows that the fraction 1/3, which is 0.333333... in base ten, is 0.555555 in hexadecimal. I think if you work through and understand these examples, you will be ready for almost anything. You have to keep in mind what the "process" is for long division, but at each step do the details with hex. You may have to slip back into base ten now and then, but only do that if you clearly tell yourself that you are doing it. For instance, in the 1/3 example above, you have to multiply 3 hex by 5 hex. You know that 3 base ten times 5 base ten equals 15 base ten, so you are almost there. You slip back into hex mode by realizing that 15 base ten is the same as F in hex. So, 3 times 5 is F. But keep those side-trips into base ten separate. You want to maintain a natural flow for the hex calculation. That is, as you are talking your way through the 1/3 division problem, you start by saying "3 goes into 10 5 times, so you write the 5 in the quotient, then multiply 3 times 5 getting F, which is written below. Then subtract F from 10 to get 1, which you write below and bring down a zero from the dividend." Etc. I hope this helps. Good luck. Write back if you need to. - Doctor Mike, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/