View Single Post
Old 01-21-2004, 05:12 PM   #4 (permalink)
n0nsensical
Junkie
 
Location: San Francisco
a. is easy.
b. BCD takes a base-10 number and encodes each digit with 4 bits of binary. For example the number 328 is represented by 0011 0010 1000. With 32 bits you can fit 8 BCD digits, so you can represent 10^8 or 100000000 numbers (0-99999999). 10^16 for 64-bit words.
c. Now this one is a little bit unclear. The answer varies depending on which ASCII characters you can use as digits. It also varies depending on whether you're using extended ASCII since each character is 7 bits if not and 8 bits if so. I'll assume 32-bit words and 8-bit characters for now. If you're only using the digits 0-9 for base-10, the answer is 10^4 or 10000. However, what if you're encoding hex numbers (base-16), then the answer is 16^4 because there are 16 possible digits, usually 0-9 and A-F. If you're using every ASCII character as a digit (base-256) you can represent 256^4 numbers. My guess is that you're supposed to assume you're encoding base-10.
n0nsensical is offline  
 

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62