diy thermometer sensitivity

On Jun 13, 3:58 pm, Jon Kirwan <j...@infinitefactors.org> wrote:
On Wed, 12 Jun 2013 17:43:18 -0700 (PDT), George Herold

gher...@teachspin.com> wrote:
snip
Say, isn't it legal to distill some of your own hooch in the US?
Maybe you need a permit/ license?

I did a little informal reading on the web about this
question (as regards the US, of course.) So take my tentative
conclusions with a huge grain of internet salt. ;)

It appears that federal law trumps state law (from what I
gather) and rules over this issue. Because of political
pressures, beer and wine makers were able to secure
exceptions under federal law for making home brews and wines.

Taxes on beer and wine are low, compared to taxes on
distilled liquors, I gather. So it may also be that it was
less of a loss for Congress' tax collection revenue stream
allowing that, as well, and so easier to secure exceptions.
Taxes on distilled liquors produced billions of dollars more
tax revenue, I gather, and arguments about the potential harm
from methanol and amyl alcohol and lead poisoning (metal
parts welded together, etc, assuming that a moonshiner would
use cheaper, more readily available materials instead of
getting appropriate laboratory equipment and/or teflon and
food grade stainless) allowed legislators to justify keeping
a strong hold on the tax revenues for hard liquors.

I found nothing yet about port, which is a fortified type of
usually blended wines. It may have it's own exemptions (in
either direction) on this issue.

What I did find is that if you are a "moonshiner" then you
need to secure at least one federal permit and pay taxes on
what you produce, even if only for personal use. I would
assume that if you sell any of it, that would be at least one
more permit, probably more fees, and probably inspections and
fees for that and who knows what else (appropriate bribes,
etc?)

Basically, if you distill for food purposes, you need a
federal permit. I don't know about "fuel purposes," though.
Congress appears to have given away huge subsidies for
ehthanol production for fuels, while insisting on retaining
huge tax revenues for food ethanol distillation. So it's
possible the laws are quite different. Or, it is possible
that to avoid people making "fuel" which they then drink,
that they've done something to close that loop, too. I have
come up with nothing on that particular topic (mostly because
I didn't dwell on it.)

Jon
Interesting, thanks. Say there is also 'freeze distilation'
http://en.wikipedia.org/wiki/Fractional_freezing#Alcoholic_beverages

Hmm a eutectic mixture is like an azeotrope. (I should go back and
learn some chemistry :^)

George H.
 
On Friday, June 14, 2013 6:22:47 AM UTC-7, George Herold wrote:
On Jun 13, 3:58 pm, Jon Kirwan <j...@infinitefactors.org> wrote:

On Wed, 12 Jun 2013 17:43:18 -0700 (PDT), George Herold



gher...@teachspin.com> wrote:

snip

Say, isn't it legal to distill some of your own hooch in the US?

Maybe you need a permit/ license?



I did a little informal reading on the web about this

question (as regards the US, of course.) So take my tentative

conclusions with a huge grain of internet salt. ;)



It appears that federal law trumps state law (from what I

gather) and rules over this issue. Because of political

pressures, beer and wine makers were able to secure

exceptions under federal law for making home brews and wines.



Taxes on beer and wine are low, compared to taxes on

distilled liquors, I gather. So it may also be that it was

less of a loss for Congress' tax collection revenue stream

allowing that, as well, and so easier to secure exceptions.

Taxes on distilled liquors produced billions of dollars more

tax revenue, I gather, and arguments about the potential harm

from methanol and amyl alcohol and lead poisoning (metal

parts welded together, etc, assuming that a moonshiner would

use cheaper, more readily available materials instead of

getting appropriate laboratory equipment and/or teflon and

food grade stainless) allowed legislators to justify keeping

a strong hold on the tax revenues for hard liquors.



I found nothing yet about port, which is a fortified type of

usually blended wines. It may have it's own exemptions (in

either direction) on this issue.



What I did find is that if you are a "moonshiner" then you

need to secure at least one federal permit and pay taxes on

what you produce, even if only for personal use. I would

assume that if you sell any of it, that would be at least one

more permit, probably more fees, and probably inspections and

fees for that and who knows what else (appropriate bribes,

etc?)



Basically, if you distill for food purposes, you need a

federal permit. I don't know about "fuel purposes," though.

Congress appears to have given away huge subsidies for

ehthanol production for fuels, while insisting on retaining

huge tax revenues for food ethanol distillation. So it's

possible the laws are quite different. Or, it is possible

that to avoid people making "fuel" which they then drink,

that they've done something to close that loop, too. I have

come up with nothing on that particular topic (mostly because

I didn't dwell on it.)



Jon



Interesting, thanks. Say there is also 'freeze distilation'

http://en.wikipedia.org/wiki/Fractional_freezing#Alcoholic_beverages

Yes! I tried it and just got a slush, unable to separate out any flammable liquids. Maybe my freezer was too cold... dunno.


Hmm a eutectic mixture is like an azeotrope. (I should go back and

Ooh! Yeah, this mentions solder (tin, lead) forms a eutectic system!

http://en.wikipedia.org/wiki/Eutectic_system


learn some chemistry :^)

Yes, it's fun =)


George H.

Michael
 
On 2013-06-13, Jon Kirwan wrote:

Taxes on beer and wine are low, compared to taxes on
distilled liquors, I gather. So it may also be that it was
less of a loss for Congress' tax collection revenue stream
allowing that, as well, and so easier to secure exceptions.
Taxes on distilled liquors produced billions of dollars more
tax revenue, I gather, and arguments about the potential harm
from methanol and amyl alcohol and lead poisoning (metal
parts welded together, etc, assuming that a moonshiner would
use cheaper, more readily available materials instead of
getting appropriate laboratory equipment and/or teflon and
food grade stainless) allowed legislators to justify keeping
a strong hold on the tax revenues for hard liquors.
ICBW, but from what I've heard they have no problems with poisonous
legal moonshine in New Zealand. Legalizing it means people can freely
buy safe equipment with good instructions, instead of improvising.

IMO, the safety argument against letting people make it themselves is
bunk. Obviously, some people would still do stupid dangerous things,
but that's true with electricity (for example).


--
I have a natural revulsion to any operating system that shows so
little planning as to have to named all of its commands after
digestive noises (awk, grep, fsck, nroff).
[The UNIX-Haters Handbook]
 
On Fri, 14 Jun 2013 18:47:57 +0100, Adam Funk
<a24061@ducksburg.com> wrote:

On 2013-06-13, Jon Kirwan wrote:

Taxes on beer and wine are low, compared to taxes on
distilled liquors, I gather. So it may also be that it was
less of a loss for Congress' tax collection revenue stream
allowing that, as well, and so easier to secure exceptions.
Taxes on distilled liquors produced billions of dollars more
tax revenue, I gather, and arguments about the potential harm
from methanol and amyl alcohol and lead poisoning (metal
parts welded together, etc, assuming that a moonshiner would
use cheaper, more readily available materials instead of
getting appropriate laboratory equipment and/or teflon and
food grade stainless) allowed legislators to justify keeping
a strong hold on the tax revenues for hard liquors.

ICBW, but from what I've heard they have no problems with poisonous
legal moonshine in New Zealand. Legalizing it means people can freely
buy safe equipment with good instructions, instead of improvising.

IMO, the safety argument against letting people make it themselves is
bunk. Obviously, some people would still do stupid dangerous things,
but that's true with electricity (for example).
I agree with your argument and believe that the US federal
gov't was obviously protecting a substantial revenue source
and attempting to disingenuously justify that protection
using this as an excuse.

Jon
 
On 2013-06-14, Jon Kirwan wrote:

On Fri, 14 Jun 2013 18:47:57 +0100, Adam Funk
a24061@ducksburg.com> wrote:

ICBW, but from what I've heard they have no problems with poisonous
legal moonshine in New Zealand. Legalizing it means people can freely
buy safe equipment with good instructions, instead of improvising.

IMO, the safety argument against letting people make it themselves is
bunk. Obviously, some people would still do stupid dangerous things,
but that's true with electricity (for example).

I agree with your argument and believe that the US federal
gov't was obviously protecting a substantial revenue source
and attempting to disingenuously justify that protection
using this as an excuse.
Oddly, though, the situation in New Zealand arose because (AIUI) the
customs officers asked the government to legalize private distillation
because they (in customs) thought it was a waste of their time & money
to try to enforce the ban!


--
The three-martini lunch is the epitome of American efficiency.
Where else can you get an earful, a bellyful and a snootful at
the same time? [Gerald Ford, 1978]
 
On Fri, 14 Jun 2013 11:41:28 -0700, Jon Kirwan
<jonk@infinitefactors.org> wrote:

On Fri, 14 Jun 2013 18:47:57 +0100, Adam Funk
a24061@ducksburg.com> wrote:

On 2013-06-13, Jon Kirwan wrote:

Taxes on beer and wine are low, compared to taxes on
distilled liquors, I gather. So it may also be that it was
less of a loss for Congress' tax collection revenue stream
allowing that, as well, and so easier to secure exceptions.
Taxes on distilled liquors produced billions of dollars more
tax revenue, I gather, and arguments about the potential harm
from methanol and amyl alcohol and lead poisoning (metal
parts welded together, etc, assuming that a moonshiner would
use cheaper, more readily available materials instead of
getting appropriate laboratory equipment and/or teflon and
food grade stainless) allowed legislators to justify keeping
a strong hold on the tax revenues for hard liquors.

ICBW, but from what I've heard they have no problems with poisonous
legal moonshine in New Zealand. Legalizing it means people can freely
buy safe equipment with good instructions, instead of improvising.

IMO, the safety argument against letting people make it themselves is
bunk. Obviously, some people would still do stupid dangerous things,
but that's true with electricity (for example).

I agree with your argument and believe that the US federal
gov't was obviously protecting a substantial revenue source
and attempting to disingenuously justify that protection
using this as an excuse.

Jon
---
I agree, but in the beginning, with George Washington's campaign
against the whiskey rebellion in Pennsylvania,

http://en.wikipedia.org/wiki/Whiskey_Rebellion

it's clear that the US federal government wasn't concerned with
whether home made whiskey is good for you or not, they were intent on
showing that they had the muscle to do whatever they wanted to and
that perpetuating the life, liberty, and happiness of the federal
government was more important than their enforcing our claim to the
same goodies, as attested to by their use of force, instead of
dialogue, to remedy their quandary and abrogate the bill of rights we
fought for, at their aegis.

It's quite different now, since we suck on the glass tit and accept
its milk as gospel.
--
JF
 
On Fri, 14 Jun 2013 20:21:13 +0100, Adam Funk <a24061@ducksburg.com>
wrote:

On 2013-06-14, Jon Kirwan wrote:

On Fri, 14 Jun 2013 18:47:57 +0100, Adam Funk
a24061@ducksburg.com> wrote:

ICBW, but from what I've heard they have no problems with poisonous
legal moonshine in New Zealand. Legalizing it means people can freely
buy safe equipment with good instructions, instead of improvising.

IMO, the safety argument against letting people make it themselves is
bunk. Obviously, some people would still do stupid dangerous things,
but that's true with electricity (for example).

I agree with your argument and believe that the US federal
gov't was obviously protecting a substantial revenue source
and attempting to disingenuously justify that protection
using this as an excuse.

Oddly, though, the situation in New Zealand arose because (AIUI) the
customs officers asked the government to legalize private distillation
because they (in customs) thought it was a waste of their time & money
to try to enforce the ban!
---
Kudos, Kiwis. :)

--
JF
 
On Fri, 14 Jun 2013 13:15:22 -0700 (PDT), mrdarrett@gmail.com wrote:

On Thursday, June 13, 2013 7:49:32 PM UTC-7, John Larkin wrote:
On Thu, 13 Jun 2013 12:11:33 -0700 (PDT), mrdarrett@gmail.com wrote:



On Wednesday, June 12, 2013 7:07:34 AM UTC-7, John Larkin wrote:



...



What kind of capacitor in parallel with R3?







Ceramic, roughly 0.1 uF, doesn't matter much.





Oh ok thanks!



...



You could software filter to smooth the noise out.







Average blocks of, say, 100 samples. Or make a continuous lowpass filter,







OUT = OUT + (IN - OUT) * K (in floats)







where K is small, like 0.01. In integer math, you can do an arithmetic



right-shift to approximate the multiply. >>7 is like multiplying by 1/128.







That's pretty amazing. Continuous low pass filter, huh? Trying to figure out why it works. Is it something like this?



http://en.wikipedia.org/wiki/Exponential_smoothing



Thanks again for all your help John!



Michael



Yep. It's a discrete-time model of an RC lowpass filter.



If K is 0.01, then the time constant is 100 times the sample interval. After the

first sample, the output jumps to 1% of the input. The second time, it jumps 1%

*of the ramaining difference*, just like a real resistor-capacitor.

--



John Larkin Highland Technology Inc

www.highlandtechnology.com jlarkin at highlandtechnology dot com



Wow.

I'm trying to remember if bit shifts work on negative numbers (for example, if IN - OUT is negative.) Should work, since the sign is the most significant bit, right? It's been too long since I took the assembly language class...

Thanks again.

Michael
An ASR is equivalent to a signed divide. You have to make sure you
have enough empty bits on the right that you don't throw away data
when you do the right-shift. That usually involves always
left-shifting the ADC data before you start, so there's room for the
right shifts.


--

John Larkin Highland Technology, Inc

jlarkin at highlandtechnology dot com
http://www.highlandtechnology.com

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom laser drivers and controllers
Photonics and fiberoptic TTL data links
VME thermocouple, LVDT, synchro acquisition and simulation
 
On Thursday, June 13, 2013 7:49:32 PM UTC-7, John Larkin wrote:
On Thu, 13 Jun 2013 12:11:33 -0700 (PDT), mrdarrett@gmail.com wrote:



On Wednesday, June 12, 2013 7:07:34 AM UTC-7, John Larkin wrote:



...



What kind of capacitor in parallel with R3?







Ceramic, roughly 0.1 uF, doesn't matter much.





Oh ok thanks!



...



You could software filter to smooth the noise out.







Average blocks of, say, 100 samples. Or make a continuous lowpass filter,







OUT = OUT + (IN - OUT) * K (in floats)







where K is small, like 0.01. In integer math, you can do an arithmetic



right-shift to approximate the multiply. >>7 is like multiplying by 1/128.







That's pretty amazing. Continuous low pass filter, huh? Trying to figure out why it works. Is it something like this?



http://en.wikipedia.org/wiki/Exponential_smoothing



Thanks again for all your help John!



Michael



Yep. It's a discrete-time model of an RC lowpass filter.



If K is 0.01, then the time constant is 100 times the sample interval. After the

first sample, the output jumps to 1% of the input. The second time, it jumps 1%

*of the ramaining difference*, just like a real resistor-capacitor.

--



John Larkin Highland Technology Inc

www.highlandtechnology.com jlarkin at highlandtechnology dot com


Wow.

I'm trying to remember if bit shifts work on negative numbers (for example, if IN - OUT is negative.) Should work, since the sign is the most significant bit, right? It's been too long since I took the assembly language class...

Thanks again.

Michael
 
On Friday, June 14, 2013 1:13:22 PM UTC-7, John Fields wrote:

....

I agree, but in the beginning, with George Washington's campaign

against the whiskey rebellion in Pennsylvania,



http://en.wikipedia.org/wiki/Whiskey_Rebellion

"Farmers who used their leftover grain and corn in the form of whiskey..." oh that's pretty smart!

Thanks,

Michael
 
"John Larkin" wrote in message
news:n21nr8h9kltdooac34hvehkt1g2mt7k21k@4ax.com...

An ASR is equivalent to a signed divide. You have to make sure you
have enough empty bits on the right that you don't throw away data
when you do the right-shift. That usually involves always
left-shifting the ADC data before you start, so there's room for the
right shifts.
It may be easier, faster, and more accurate to just total 64 10 bit readings
to get a 16 bit integer, and then use integer math to compare that reading
to integer high/low setpoints.

Paul
 
On Friday, June 14, 2013 4:20:11 PM UTC-7, P E Schoen wrote:
"John Larkin" wrote in message

news:n21nr8h9kltdooac34hvehkt1g2mt7k21k@4ax.com...



An ASR is equivalent to a signed divide. You have to make sure you

have enough empty bits on the right that you don't throw away data

when you do the right-shift. That usually involves always

left-shifting the ADC data before you start, so there's room for the

right shifts.



It may be easier, faster, and more accurate to just total 64 10 bit readings

to get a 16 bit integer, and then use integer math to compare that reading

to integer high/low setpoints.



Paul

Yes you have a point. Probably need to use long ints (32 bits) though because worst case, 2^10 = 1024, 1024 x 64 = 65536 which is > 32737.

Eventually I'll want something more sophisticated than simple on-off.

Y'all are familiar with this kind of stuff, right? Process Control drove me nuts in college. Maybe because our professor didn't explain it very well... ("Why not simply use a thermostat?" lol)

http://en.wikipedia.org/wiki/PID_controller

Thanks,

Michael
 
On Sat, 15 Jun 2013 09:29:11 +1000, <mrdarrett@gmail.com> wrote:

On Friday, June 14, 2013 4:20:11 PM UTC-7, P E Schoen wrote:
"John Larkin" wrote in message

news:n21nr8h9kltdooac34hvehkt1g2mt7k21k@4ax.com...



An ASR is equivalent to a signed divide. You have to make sure you

have enough empty bits on the right that you don't throw away data

when you do the right-shift. That usually involves always

left-shifting the ADC data before you start, so there's room for the

right shifts.



It may be easier, faster, and more accurate to just total 64 10 bit
readings

to get a 16 bit integer, and then use integer math to compare that
reading

to integer high/low setpoints.



Paul


Yes you have a point. Probably need to use long ints (32 bits) though
because worst case, 2^10 = 1024, 1024 x 64 = 65536 which is > 32737.

Eventually I'll want something more sophisticated than simple on-off.

Y'all are familiar with this kind of stuff, right? Process Control
drove me nuts in college. Maybe because our professor didn't explain it
very well... ("Why not simply use a thermostat?" lol)

http://en.wikipedia.org/wiki/PID_controller

Thanks,

Michael
Did you say you are using Arduino? In which case you are programing in C
and the language will take care of the division and sign for you
 
On Friday, June 14, 2013 6:58:18 PM UTC-7, David Eather wrote:

....

Did you say you are using Arduino? In which case you are programing in C

and the language will take care of the division and sign for you

Yes, I am, and I know.

I just wanted to clarify if I did do a bit shift to divide by 128, would the sign be preserved if the delta happened to be negative. Apparently the answer is no...

Thanks!

Michael
 
mrdarrett@gmail.com wrote:
On Friday, June 14, 2013 6:58:18 PM UTC-7, David Eather wrote:

...


Did you say you are using Arduino? In which case you are programing in C

and the language will take care of the division and sign for you



Yes, I am, and I know.

I just wanted to clarify if I did do a bit shift to divide by 128, would the sign be preserved if the delta happened to be negative. Apparently the answer is no...

Thanks!

Michael

Like most logical bit operations, the sign bit is just another bit..
shift that to the right, and it's gone.

Unless you use some carry operation, the upper bit should be cleared.

P.S.
if you are doing multiple machine words for large values, then you
need to use the carry flag to include that in the shift for the next
machine word.


Jamie
 
On 2013-06-14, mrdarrett@gmail.com wrote:

On Friday, June 14, 2013 1:13:22 PM UTC-7, John Fields wrote:

...

I agree, but in the beginning, with George Washington's campaign

against the whiskey rebellion in Pennsylvania,



http://en.wikipedia.org/wiki/Whiskey_Rebellion


"Farmers who used their leftover grain and corn in the form of whiskey..." oh that's pretty smart!

Recycling is a good thing.


--
A recent study conducted by Harvard University found that the average
American walks about 900 miles a year. Another study by the AMA found
that Americans drink, on average, 22 gallons of alcohol a year. This
means, on average, Americans get about 41 miles to the gallon.
http://www.cartalk.com/content/average-americans-mpg
 
On Friday, June 14, 2013 2:03:04 PM UTC-7, John Larkin wrote:

....

An ASR is equivalent to a signed divide. You have to make sure you

have enough empty bits on the right that you don't throw away data

when you do the right-shift. That usually involves always

left-shifting the ADC data before you start, so there's room for the

right shifts.

Ah, the subtleties of AVR arithmetic shifts are a bit beyond me, I think. Thanks though.

Partial C code snapshot:

void loop() {
f_reading = f_reading + 0.01 * ( analogRead( THERM_PIN ) - f_reading );
if( (++i % 2500 ) == 0 ){
Serial.print( "Average: " );
Serial.print( f_reading );
Serial.print( " Instantaneous: " );
Serial.print( analogRead( THERM_PIN ) );
Serial.print( "\n" );
...
}

Output:
Average: 559.29 Instantaneous: 558
Average: 561.61 Instantaneous: 564
Average: 564.04 Instantaneous: 563
Average: 567.14 Instantaneous: 569
Average: 567.03 Instantaneous: 569
Average: 570.22 Instantaneous: 571
Average: 572.63 Instantaneous: 577
Average: 574.74 Instantaneous: 576
Average: 577.94 Instantaneous: 578
Average: 580.52 Instantaneous: 576

Outputs are very nicely averaged by 2500 iterations. Arduino can do about 5000 iterations per second, and this gives me about two data points per second.

Thanks again,

Michael
 
On 2013-06-15, mrdarrett@gmail.com <mrdarrett@gmail.com> wrote:
On Friday, June 14, 2013 6:58:18 PM UTC-7, David Eather wrote:

...

Did you say you are using Arduino? In which case you are programing in C

and the language will take care of the division and sign for you


Yes, I am, and I know.

I just wanted to clarify if I did do a bit shift to divide by 128,
would the sign be preserved if the delta happened to be negative.
Apparently the answer is no...
In assembler you use the ASR op-code *
In "C" the result is implementation defined, check your compiler
documentation.

I'd expect "avr-gcc" to get the answer right. which by reading the
assember output it appears to do (inefficiently)


(* actually in assmber for a divide by 128 you stash the low bit
(high bit of the low byte) move everything right by one byte, shift
the low bit back in and ripple up threough the intermediate bytes (if
any) and then restore the high byte using ADC and then CMP )


--
⚂⚃ 100% natural

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
 
On Wed, 12 Jun 2013 17:37:05 -0700 (PDT), George Herold
<gherold@teachspin.com> wrote:

On Jun 12, 4:11 pm, mrdarr...@gmail.com wrote:
On Wednesday, June 12, 2013 12:36:25 PM UTC-7, George Herold wrote:

...





LM71 is nice, too.

+/- 1.5 degrees accuracy - he is trying to control to within 1 degree

(it almost sounds like he is trying to separate methanol from ethanol)

Your guess is pretty darned close ;)

Michael- Hide quoted text -

- Show quoted text -

Oh, Are you distilling ethanol from water?

Haha, I plead the Fifth.  The closer I can get to the 95% EtOH-H2O azeotrope at around 78 degrees (seems like the exact number depends on which source you read 78.2? 78.3? 78.5? I give up)

I'm pretty sure, (though I don't know for sure... like if I did the
measurement) that the temperature will change with external pressure,
so What's your altitude, and is there a cold front passing through?

I'm thinking of water, where at higher altitudes, you've gotta boil
your eggs for more than 6.5 minutes, for that hard white, soft yellow
that I like.
First time I did mashed potatoes up here in Truckee, they came out
raw. It takes a full hour. At higher altitudes, it might not be
possible without a pressure cooker.

Just speculating, but if you just slowly add heat to a water-alcohol
mix, won't the alcohol boil off first? It's sort of self-regulating. I
don't know how pure the distillate would be.
 
On 6/15/13 4:28 PM, Jasen Betts wrote:
On 2013-06-15, mrdarrett@gmail.com <mrdarrett@gmail.com> wrote:
On Friday, June 14, 2013 6:58:18 PM UTC-7, David Eather wrote:

...

Did you say you are using Arduino? In which case you are programing in C

and the language will take care of the division and sign for you


Yes, I am, and I know.

I just wanted to clarify if I did do a bit shift to divide by 128,
would the sign be preserved if the delta happened to be negative.
Apparently the answer is no...

In assembler you use the ASR op-code *
In "C" the result is implementation defined, check your compiler
documentation.

I'd expect "avr-gcc" to get the answer right. which by reading the
assember output it appears to do (inefficiently)


(* actually in assmber for a divide by 128 you stash the low bit
(high bit of the low byte) move everything right by one byte, shift
the low bit back in and ripple up threough the intermediate bytes (if
any) and then restore the high byte using ADC and then CMP )
I'm an 80x86 guy (and not the OP), but I'm curious about what you're
talking about here... It seems likely you've missed negative values, but
I could me missing the full thing.

So, lets say I have a 4 bit 2's compliment number, 1101 (-3). and I want
to divide by four. normal shifting will fail entirely, resulting in
0011 (3). Sign extended shifting will be closer, but still wrong 1111 (-1).

I would either need a real "divide" instruction, or I would need to
check the sign, and then if < 0, I would negate and shift and negate
back. Unless there is some other nifty trick I'm missing. I'd love to
see it.

Either way, if the OP wants to use (x >> 7) in C, they will find
negative values of x don't result in the desired value of x/128;
 

Welcome to EDABoard.com

Sponsor

Back
Top