QuadRogue's Blog

What I See Is What You Get

On Melancholy Hill – tabs September 2, 2010

Filed under: music — Quad @ 11:46 am

Hmmm… so, I heard this song On Melancholy Hill by the Gorillaz a few months ago and the melody was an immediate hit with me. I think Damon Albarn’s really talented in making melodies. I tried to make a cover of it the moment I heard the song and I think it sounds pretty good on acoustic. Simple progression and amazing melody.

Up on melan… Tree… …with me?

e |————————————————————————————–|

B |————————————————————————————–|

G |————————————————————————————–|

D |————————————————————————————–|

A |3333333333333333——————0000000000000000————————————|

E |—————–3333333333333333——————1111111333333333-1111111333333333–|

==================================================|

|1234567812345678-1234567812345678-1234567812345678-1234567812345678-1234567812345678–|

e |–3——3–3——3——–3–3—-3——3–3——3——3–3——3——3–3—–|

B |1——1—1–1–0——–0–0—-1——1—1–1–1—-1-0—0–0–1—-1-0—0–0—|

G |————————————————————————————–|

D |————————————————————————————–|

A |3333333333333333——————0000000000000000————————————|

E |—————–3333333333333333——————1111111333333333-1111111333333333–|

Now, the tabs look so untidy, the reason being that I wrote the tabs on a notepad that uses simple text. But, when I copied it to this blog, the ‘-’ size is so small that the lines started looking uneven as you see above. So, I wanted to change the ‘-’s to ‘=’s since they have the same size as the numbers and texts. Now, I didn’t want to change every ‘-’ into a ‘=’ by hand and sit there making sure the all lines are equal length so the tabs are at the right place.

So, since I have been learning PERL for some time, I thought I’d write a PERL script to change all the ‘-’s to ‘=’s. Regular Expressions. Here’s the PERL script.

open (MYFILE1, '<tabs.txt');
open (MYFILE2, '>editedtabs.txt');
while (<MYFILE1>){
      my($line) = $_;
      #chomp($line);
     $line =~ s/-/=/g;
     print "$line\n";
     print MYFILE2 $line
}
close (MYFILE1);
close (MYFILE2);

Here’s the output I got.

  Up on melan...   Tree...  ...with me?
e|======================================================================================|
B|======================================================================================|
G|======================================================================================|
D|======================================================================================|
A|3333333333333333==================0000000000000000====================================|
E|=================3333333333333333==================1111111333333333=1111111333333333==|

 |1234567812345678=1234567812345678=1234567812345678=1234567812345678=1234567812345678==|

e|==3======3==3======3========3==3====3======3==3======3======3==3======3======3==3=====|
B|1======1===1==1==0========0==0====1======1===1==1==1====1=0===0==0==1====1=0===0==0===|
G|======================================================================================|
D|======================================================================================|
A|3333333333333333==================0000000000000000====================================|
E|=================3333333333333333==================1111111333333333=1111111333333333==|

Well, I had to change the font again since, it was too long for the layout. But, the PERL script did what I intended it to, change ‘-’s to ‘=’s.

Now, to explain the script, MYFILE1 and MYFILE2 are filehandles which let us open the files for reading or writing. The ‘<’ sign before the file name tells the interpreter that the file is being opened for reading. The ‘>’ sign tells the interpreter that the file being opened is opened for writing. We’re storing each line read in $line so that it can be operated on. The chomp function is used to get rid of the ‘\n’ at the end of each line. I didn’t use that because  I wanted the separate lines. s/regex/replacement/g is the regular expression that replaces the regex with the replacement. ‘s’ is the keyword for replacement and ‘g’ tells the interpreter to do a global regex replacement, meaning replacing ‘-’ with a ‘=’ everywhere in the file.

By the way, here’s the link to my video http://www.youtube.com/watch?v=lkxpdlyQq4o

But, it turns out that if I change the font for the tabs with the ‘-’s I can get them aligned and I wouldn’t have had to write a PERL script to change the hyphens to ‘equal to’ signs. But, I learned to do something useful.

   Up on melan...   Tree...  ...with me?
e |--------------------------------------------------------------------------------------|
B |--------------------------------------------------------------------------------------|
G |--------------------------------------------------------------------------------------|
D |--------------------------------------------------------------------------------------|
A |3333333333333333------------------0000000000000000------------------------------------|
E |-----------------3333333333333333------------------1111111333333333-1111111333333333--|

  |1234567812345678-1234567812345678-1234567812345678-1234567812345678-1234567812345678--|
e |--3------3--3------3--------3--3----3------3--3------3------3--3------3------3--3-----|
B |1------1---1--1--0--------0--0----1------1---1--1--1----1-0---0--0--1----1-0---0--0---|
G |--------------------------------------------------------------------------------------|
D |--------------------------------------------------------------------------------------|
A |3333333333333333------------------0000000000000000------------------------------------|
E |-----------------3333333333333333------------------1111111333333333-1111111333333333--|
Up on melan…   Tree…  …with me?
e |————————————————————————————–|
B |————————————————————————————–|
G |————————————————————————————–|
D |————————————————————————————–|
A |3333333333333333——————0000000000000000————————————|
E |—————–3333333333333333——————1111111333333333-1111111333333333–|

==================================================|

|1234567812345678-1234567812345678-1234567812345678-1234567812345678-1234567812345678–|

e |–3——3–3——3——–3–3—-3——3–3——3——3–3——3——3–3—–|
B |1——1—1–1–0——–0–0—-1——1—1–1–1—-1-0—0–0–1—-1-0—0–0—|
G |————————————————————————————–|
D |————————————————————————————–|
A |3333333333333333——————0000000000000000————————————|
E |—————–3333333333333333——————1111111333333333-1111111333333333–|

 

The stupid interconnect. September 1, 2010

Filed under: computer,science — Quad @ 9:34 am

Interconnects are inevitable in a VLSI design. Especially, in SoCs. Signals need to be routed between blocks using interconnects. Now, there are parasicitcs in all metals when electricity passes through them. These parasitics cause the delays in the metals when they are used as interconnects. In fact, these parasitics are responsible for the propagation delay and switching delays in the MOSFETs. For an interconnect,


Where t is the interconnect thickness, L is the interconnect length, W is the interconnect width and Rs is called the sheet resistance. But, we need to take the fringe capacitance into account when the interconnect is close to the substrate. Higher metals don’t experience much of fringe capacitance. The actual capacitance is given by


Time constant


Apart from these parasitics, when we deal with high frequency signals (fast switching), an inductance parameter comes into play. The propagation delay is affected by the inductance parameter in addition to the resistance and capacitance. For example, when VDD is supplied to the source terminal of a pMOS, the actual voltage available at the terminal is VDD – V(t) where V(t) is the voltage drop generated by the inductance given by, V(t) = L (di/dt). Therefore, the actual VDD available to the pMOS source is vdd = VDD – V(t). This happens to every gate and transistor in the fast switching network.

Another parameter known as the characteristic impedance comes into play for high speed signals. These are transmission line parameters usually dealt with in board level design. But, the moment rise time and fall times go below a certain limit, these parameters come into the picture. Proper impedance matching has to be done to avoid signal reflections and degradation. Generally, when

signal tr < 160ps,

R < 5Z0

tr or tf < 2.5tflight

we need to consider characteristic impedance (transmission line effects).

One more effect of high speed signals is the skin effect where the signal tends to flow on the surface of the wire for very high frequencies. What happens is that the resistance if the line is also dependent on the skin depth because it essentially reduces the wire width. Naturally, when the wire dimension is reduced the resistance is increased and distortion is experienced on the signal at high frequencies.

We can notice that the time constant Ƭ depends on R and C (and also L of the line at times) and becomes proportional to square of L

Ƭ ά L2

To model the interconnect delay, we divide the whole line into m RC rungs of a ladder network (Distributed model.) such that \

Rm = Rline/m

Cm = Cline/m

=

As m approaches infinity for a long interconnect

From calculations propagation delay

so,

because pMOS gives the logic ’1′ and nMOS gives the logic ’0′.

Using the rise time and fall time delays the total propagation delay from input to output can be found by the formula

These are all dependent on the L and W parameters of the line using which we can alter the delays.

 

 
Follow

Get every new post delivered to your Inbox.