Ramsey Electronics CT255 manual Bit # Value 128

Models: CT255

1 28
Download 28 pages 51.85 Kb
Page 11
Image 11

128 times to get the most significant LED to change state just once.

Normally an 8 bit number has these significant values:

Bit #:

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Value:

128

64

32

16

8

4

2

1

 

 

 

 

 

 

 

 

 

Say bits 7, 3, and 0 are on, all others are off. The value would then be 128 + 8 + 1 or 137.

Say instead bits 6, 5, 4 and 1 are on, all others are off. Our value would then be 64 + 32 + 16 + 2 or 114.

Our display is set up to read from 0.0 degrees to 127.5 degrees in 1/2 degree steps. What we do is stick in an imaginary decimal point to the left of the LSB (least significant bit) and then divide all the numbers by 2.

Bit #:

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Value:

128/2

64/2

32/2

16/2

8/2

4/2

2/2

1/2

 

 

 

 

 

 

 

 

 

Say instead bits 6, 5, 4 and 1 are on, all others are off. Our value would then be 32 + 16 + 8 + 1 or 57, which is 1/2 of 114.0. This means that we have a temperature reading of 57 degrees!

Now since we have used 8 bits for our counter, this is considered a single byte of data. This value, with the decimal point in place, is now called a fixed-point number. This means that the decimal point can never move, even when we perform mathematical operations on it. This number is now considered a 7.1 format fixed point binary value, meaning there are seven binary digits to the left, one to the right of the decimal point.

You may have heard of fixed-point DSPs; these use the same principle, only a lot more bits, and the values never surpass 1 or –1 since they shift the decimal point all the way to the left of the MSB. If there were such a thing as an 8-bit fixed point DSP, the bit values would be as follows:

Essentially take our number from before and divide by 256, or 144/256 = 0.445. DSPs do this to prevent math from overflowing in value as you multiply and accumulate. DSPs handle this math very quickly.

Bit #:

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Value:

128/256

26/256

32/256

16/256

8/256

4/256

2/256

1/256

 

 

 

 

 

 

 

 

 

CT255 11

Page 11
Image 11
Ramsey Electronics CT255 manual Bit # Value 128