homelist of postsdocsγ ~> e-about & FAQ

Proper? way of drawing circuit diagarams

This topic has probably been hot for as long as conscious circuit design has been exsistent. I personally have had various discussions with colleagues and friends, and I have been changing my opinion about circuit drawings for a number of times throughout the past ten years. Randomly browsing online, I stumbled upon this:

IEC-61082-1 INTERNATIONAL STANDARD - Preparation of documents used in electrotechnology

Such a wonderful useless document, which also costs 310 CHF which today is equivalent of ~254 EUR, whaaaat? I admit probably the 310 CHF is the fact that makes it totally useless. This is a document which is supposed to be a primer, an example of how one should document circuit designs, so that the latter are readable by others. I assimilate this document as e.g. an English-English or any other language dictionary, how can you learn and follow one language, when you have closed resources?

If we disregard my anger that this rag costs a fortune, let's have a brief look at it, or at least focus only on how in accodrance to IEC-61082-1 one should draw nets and junctions. Luckily someone has uploaded a 2002 draft version of this document in the semi-disgustingly-pirate website Sribrbrbrrdddd.

Let's zoom into the junction and wire crossing problem, which probably forms the "prettiness" of a circuit. Or at least if one follows one junction and wire crossing rule in his schematics "everything" tends to go well.

Excerpt from IEC-61081-1 (draft version 2002), source:Scribd

Reading further in the document we see that wire crossings sould be done at 90 degree angle and the hopping-over style according to this standard is considered as wrong. In many aspects I can see why it is considered as a bad practice, as if one has many wire crossings the hopping-over style tends to mess-up the diagram. Just a guess about where the hopping-over style comes from is that (maybe) back in the old days when one had to use pens (possibly fountain too) and ink, it is kind of easy to draw a joint unintentionally just by slowing down when drawing you line, or in general shaking your hand, you get what I mean. So, based on the 61081-1 draft here's a summary of the junction and wire crossings:

A simplified summary of the 61081-1 year 2002 standard in terms of junctions and wire crossings

In practice - so far I have seen an infinite number of tastes when it comes to schematic diagrams. Probably the most important rule to have in mind is not really following the standards, but to be consistent in how you draw. If we disregard junctions and wires, there come the symbols, and these may vary a lot with EDA tools and various foundry PDKs. E.g. how come the bulk of a mosfet should go out in the middle of the "transistor channel" and there should be no drain/source markings whatsoever. There IS a difference between drains and sources, that's why people have given them different names!

And at last, the famous "in accordance with standard" circuit diagram from xkcd.

Electric eels save the day, source: xkcd

I am wishing you happy Saturday's circuit designing!

Date:Sun May 31 10:40:00 CEST 2014

Ironies of automation.

Now it has been lately quite some time trying to improve my page generation script, as well as having to fiddle around with some helper scripts at work that are supposed to make our life easier. By a coincidence last week I was visiting some friends in Sweden, from topic to topic, quite late in the evening I was recommended a paper title which appeared to be extremely entertaining to read.

It focuses on the ways in which automation tries to heal problems with human machine operators and the total man-hour labour efficiency when you draw the line accounting the time and complexity required to create the latter automation systems.

Date:Tue Apr 01 20:42:00 CEST 2014

A continuation of the content management script.

I have been fiddling a bit with my page content management script. So now except the pages I am also auto-generating the page bars too. As another field test I will just as well share the skeleton of my generator.

We first have the basic stuff:

 ############## EDIT THIS ###########################
OUTPUT="/media/05022eeb-bcac-4484-8eb0-1b41d4eae750/site-tex-res/site-sync/dilemaltd.com/public_html/deyan-levski/test/"
FILE="index.htm"

DIRECTORIES="\
/media/05022eeb-bcac-4484-8eb0-1b41d4eae750/site-tex-res/site-sync/dilemaltd.com/public_html/deyan-levski/test/post/ \
"
FILENAMES='post*.htm'

#################################################### 
I.e. I look through the "post" folder and the html files in it and then build-up the pages by concatinating a base skeleton and the posts e.g.:

DATE=date
echo $BASE >>$OUTPUT$FILE #declare -i cnt #declare -i p cnt=0 dobase=0 p=0 for f in$FILENAMES; do
for i in find $DIRECTORIES -type f $$-iname "*f*" ! -iname "*~" ! -iname ".*"$$ | sort -V -r ; do #flinedate=$(head -n 1 $i) #Auto file date fetch stuff, that is currently not implemented. #echo$date

cnt=expr $cnt + 1 if [ "$cnt" -lt 5 ] && [ "$p" -eq 0 ] then CATSTR=$OUTPUT$FILE cat$i >> $CATSTR elif [ "$cnt" -lt 5 ] && [ "$p" -ne 0 ] then CATSTR=$OUTPUT$p$FILE
cat $i >>$CATSTR

else
cnt=0
p=expr $p + 1 CATSTR=$OUTPUT$p$FILE
dobase=0
if [ "$dobase" -eq 0 ] then echo$BASE >> $CATSTR dobase=1 fi cat$i >> $CATSTR fi done done  Then generate the pagebar: z=0 for k in { 0..$p }; do # Generate bottom Page bar

CATSTR=$OUTPUT$z$FILE MAININDEX=$OUTPUT$FILE if [$z -ne 0 ]
then
olz=0
echo "
Page: " >> $CATSTR for r in seq 0$p;do
olz=expr $olz + 1 if [ "$olz" -eq 1 ]
then
echo "0  " >> $CATSTR else olzt=expr$olz - 1
echo "$olzt " >>$CATSTR
fi
done
echo "" >> $CATSTR echo "Last edited:$DATE by $USER" >>$CATSTR
echo "\n" >> $CATSTR else olz=0 echo " Page: " >>$MAININDEX
for r in seq 0 $p;do olz=expr$olz + 1
if [ "$olz" -eq 1 ] then echo "0 " >>$MAININDEX
else
olzt=expr $olz - 1 echo "$olzt  " >> $MAININDEX fi done echo "" >>$MAININDEX

echo "Last edited: $DATE by$USER" >> $MAININDEX echo "\n" >>$MAININDEX
fi
z=expr \$z + 1
done

The latter also completes the end of the HTML and adds Last edit tag. We can then look at all our files and upload them to the server.

 # Connect to FTP and upload htmls.
ftp -n -v www.dilemaltd.com << EOT
ascii
user xxxx
prompt off
cd public_html/deyan-levski/test/
mput *.htm
cd post
mput post/*.htm
quit
EOT


In an ideal world I can possibly extend this in the same fashion and make it a generic piece of code. If I do so, I will for sure write a proper post about it.

Date:Sun Mar 30 15:47:00 CEST 2014

Easing up the generation of these pages.

OK, I guess I am a bit old-fashioned, I am still keeping these pages in pure HTML and do not want to port them to blogspot, wordpress, etc... Except my stubbornness it might partly be that I find most of the blog templates quite "not-so-much-content-focused", instead these emphasize on shapes, colors and ads, rather than keeping information content as readable as possible (might not be the case with my HTML template though, but still...). One drawback of writing your pages in HTML is the difficulty to maintain a good content tracking and reduce the effort put into organizing these pages.

I am somewhat excited to be able to create and keep a good content management system which I hope will reduce my writing effort. In some hours of thinking, I have the skeleton of my system and decided to try it out, add a new (this) post, and see how it goes.

Date:Sun Mar 30 14:22:00 CEST 2014

Attacking a!b!=a!+b!+c! the brute-force engineering and analytic mathematical ways.

Not very long ago I had an argue about whether there is a solution to the equation a!b!=a!+b!+c!. It was an argue between a mathematician and engineer, so while my math friend was trying to find the solution to the problem the scientific (analytical mathematic) way I decided to give it a try and brute-force it using some nested loops in Matlab. Initially I somehow made a simple uncatchable syntax mistake and my program seemed to be looping forever. The very same evening my math soul continued with the analytical solution and finally came with a statement that the equation does not have a solution. We both agreed and assumed that we are all right.

Well, the day after we found out that there indeed is at least one solution. This is a=3, b=3, c=4. The conclusion I want to bring here is that no matter how good one is in his profession, his self-confidence should stay at maximum 0.999999999999999999.

Interested in the analytical solution? Read here. Interested in the brute-force method? Find the nested loop Matlab script here.

Date:Sun Mar 15 12:46:50 CEST 2014