|
|
May 21, 1998
Binary logic
I have some comments for Bert Erickson's Design Idea "Program
provides integer-to-binary conversion" (EDN, March 2, 1998, pg 110).
First, the basis of all computers and processors used today is binary
logic; these devices store and process everything as binary data. Other representations,
such as integer, are for convenience. Once you know how the underlying structure operates,
then this program is redundant. Why do you need to convert "binary" to
"binary"?
Assuming that you need to do this conversion, the method provided is
inefficient. A compiler stores the integer as 32 bit words. So, you
just need to strip each bit by bit and assign it to the array c[ ]. The code snippet follows:
Before writing code, it would be better to remember that you are using a
compiler and running the code on a machine that uses binary logic.
The above code runs more than 20 times faster than the one published (I
was using an Ultra 2). If you use a processor with no floating-point unit, it would run
200 times faster!
C also provides all the required bit-wise operators to write efficient
programs without having to do this conversion.
Vivek Shenoy
Synopsys, Arcad group
Montpellier Cedex 1, France
Design Ideas ideas
Your Design Ideas always contain valuable information, but I would like
to add some words of caution to two of your recent contributions: "Fax saver cuts
wear, tear, and power" (EDN, Jan 1, 1998, pg 102) and "DC/DC converter operates
from phone line" (EDN, Jan 15, 1998, pg 95).
Both circuits are designed to connect to the telephone network. As such,
they are subject to registration under FCC Part 68. Connecting the circuits prior to
registration is a violation of FCC rules. Readers should be cautioned about the regulatory
requirements.
Technically, the circuit in the fax-saver Design Idea should be capable
of meeting the FCC's rules, as long as it doesn't draw excessive dc on-hook current.
However, the circuit in the dc/dc-converter Design Idea is unlikely to meet Part 68
registration rules. When the telephone is on-hook (quiescent), the resistance presented to
the network must be greater than 5 MOhm to 100V. This fact
translates into a permissible current draw of 10 µA at 48V, limiting output current
(assuming 70% efficiency) to 67 µA at 5V. In the off-hook (loop) state, more current is
available, but it is delivered at a voltage reduced from 48V by a local loop resistance as
high as 1800Ohm. FCC rules prohibit drawing substantial loop current (going off-hook) for
anything other than placing a call or programming a telephone.
The kernels of genius in these application ideas are welcome, but in
some cases should be labeled "Don't try this at home."
Roland W Gubisch
Intertek Testing Services
Boxborough, MA
Regarding the algorithm in the Design Idea "Algorithm extracts cube
root" (EDN, Jan 15, 1998, pg 100), I think the math is flawed.
As the derivative of r3 is 3r2, the approximate
formula should be:
r_next=r+(numr3)/3r2,
(similar to the equation used for square-root approximation, right?),
which gives
(num+2r3)/3r2
and not
r_next=(num+r3)/2r2,
as in the code. The latter works but converges less quickly, I think.
Richard A Ross
TeleMedia Devices Inc
Berkeley, CA
Author's note: The gentleman is correct. His changes do make the
routine converge more quickly. However, with enough iterations, both versions will
calculate the answer to the same accuracy.
RIP
Several readers have
informed EDN that the LM389 in the Design Idea "Metal detector uses single IC"
(EDN, Dec 18, 1997, pg 94) has become obsolete and is no longer available. The authors
propose using an LM386, connected as shown in Figure 1.
Corrections and updates
In "IrDA controller simplifies interfacing, protocol issues"
(EDN, Dec 4, 1997, pg 22), the price for the TSLM1100 is incorrect. The correct price is
$5.55 (1000). Also, in "SmartMedia density, connectivity options expand" (EDN,
April 9, 1998, pg 18), the price for the 16-Mbyte, two-chip SmartMedia device is
incorrect. The correct price is $48 (50,000). We apologize for the errors.
Sound off
Send your letters to Signals and Noise Editor, EDN, 275 Washington St,
Newton, MA 02158 or e-mail us at kase@cahners.com.
Our fax is 1-617-558-4470. EDN reserves the right to edit letters for clarity and length.
|