Unusual Bases for Number Systems
Prev: Some Elementary Functions
Next: Gray Code
Sections
12-1Base12-2Base12-3Other Bases12-4What Is the Most Efficient Base?
Problems
-
Schroeppel’s formula for converting from base to binary has a dual involving the constant
0x5555555. Can you find it? -
Show how to add 1 to a base number using the arithmetic and logical operations of a binary computer. For example,
0b111becomes0b100. -
Show how to round a base number down, in the negative direction, to a multiple of 16 using the arithmetic and logical operations of a binary computer. For example,
0b10becomes0b110000. -
Write a program, in a language of your choice, to convert a base integer to the form , where and are real integers. For example, if you give the program the integer
33, or0x21, it should display something like . -
How would you convert a number in base to its negative? Extract its real part? Extract its imaginary part? Convert it to its complex conjugate? The complex conjugate of is .