Thursday, May 17, 2012

Birthday poem

Four drops of words
Oozes from my heart
Blended with joy
Fused not to part

Trickling in my mind
Pouring from my eyes
Falling to fly
Flying to pacify

Four drops of words
Oozes from my heart
Elixir to my woes
Woes to my sorrow

Floods amidst you
Amidst you it dries
Cradle you hold
Vault, with you, lies

Four drops of words
Oozes from my heart
Former Happy Birthday
Latter Dear Love

"bandh madness"

well i heard that till may 27th  there are gonna be lots of protests in Nepal. But there are some funny facts about  Nepal bandh(shutdown of the whole nation) that always makes me laugh.

1. There are just 4 or 5 people standing at roundabouts telling dozen of riders to go back!
2. Protest start at 9 or 10 am but by the time it's 1 pm, most of the places are already deserted.
3. Somehow these VIPs, with siren and guards are able to reach anywhere at anytime during bandh.
4. More than 80 percent of citizen don't even now the reason behind the bandh.
5. We never see the top leaders who called for Nepal bandh anywhere around!

I hope that someday people will start thinking about the actual achievement gained from all these shutdowns!

Monday, May 14, 2012

initiative

I ride a bike and most of the time i ride alone. Sometimes i feel like if i could give someone a lift on my way to college then i'd be helping both the traffic as well as that person.
So i was thinking of starting a social club called " the transporters" yeah not a savvy one but still. so i was thinking i'd ask people with vehicle to join this club and make other people see their daily travel route. So that others can request for a ride.
I think this initiative will help lot of people!

experiment .1

I rather like it to call a general observation than an experiment. I found that when someone is listening to a song and driving at the same time, the speed of the vehicle is determined by the genre of the music being played. For example when blues or jazz is being played, the speed of vehicle will be less. Whereas during the genre such as alternative, rock, punk rock, the speed of the vehicle will be high. But then i realized the different genre of music have profound affect of certain particular instrument. And then i cross examined the average speed of the vehicle with the interest of people. The result was interesting.
Those people who loved rock had higher speed than the ones who loved soft rock. And those people who loved jazz and blues had even less average speed than the ones who love alternative rock, soft rock etc.
So if you want any of your friends who drives really fast then make them listen to slow music , it will definitely work!

Saturday, May 12, 2012

Inception .5

People love site seeing. And there are major places around the world which is famous for it's natural beauty and scenic view. But not all people can afford to go to these places. But they do have an access to internet. So i was thinking why not place cameras in these places and with the 4G network being implemented around the world, a high quality video can be streamed live from these key places. say empire state building, or Eiffel tower. And it will work because these key places are famous for some key events and these cameras will also act as live feed for those events! Set up a internet site and then charge the viewers!

story of a mannequin

Anybody interested in making a short movie? I think I've this wonderful idea. So what happens is, there are two mannequins, a girl and a boy, placed in two shops in a mall facing each other. And there is something strange going on every night in the mall. Everyday the shopkeeper takes the mannequins inside for display. But these two mannequins all of a sudden appear facing towards the window every morning. people change the posture of these mannequins but every morning, they appear to be touching the window with both the hands watching to the other side. looking at each other.
One day the girl mannequin is taken away from the other shop. And all of sudden every morning the boy mannequin has water oozing out of it's eyes. This happens for a long time and then one day another girl mannequin is brought in the opposite shop. And the phenomenon continues..
well you can add your own ending, but i think strong emotions can be portrayed through the blank faces!!

Space

I'm really terrible when it comes to giving space to people. I really don't understand the standard protocol. What is the circumference of projection of space on the normal plane to earth's radius. What is the average duration? Do i divide the duration into equal periods. Does giving a miss call count? I usually get away by acting silly but i really need to get a grasp on this so called "PERSONAL SPACE".

inception. 4

I think people love being heard. And since this is an era of electronics communication, if you combine people's want and digital device, you will be able to earn a lot.
so this idea came to me when i was roaming around the city and saw all those led screens where myriad of advertisements were being displayed. So i thought if i could just place these big led screens around the key city area and charge people for displaying their messages sent via sms it would be really cool.
imagine you are with your girlfriend or a boyfriend wandering around the city and then in the big screen there is the message you wanted your sweetheart to see.: )

Inchoate song

I love singing and writing songs. I've written more than a dozen of songs, but for some reason i'm not being able to complete this group song at all. I've just got here so far!

i've tried it every time
have never backed down
i'm built to go ahead
as they've always said

i'll never let you down
will always be around
to see if your Okay
and i know i can say

Give me your hand and
i'll lead the way
i'll be your light and
i'll show you the way

Chorus:

Just give it away
just let it be
i'll be your sunshine
believe in me

Friday, May 11, 2012

wakeful. 1

Yes i think i'm turning into an insomniac. I heard that there are five stages in our sleep cycle. And the most important being rapid eye movement or REM phase. This is the actual phase where we dream. It is when our subconscious is actually at its best. And this phase is important for us to remember stuffs too.
But the problem is i'm not being able to achieve this phase more often these days. I don't know the exact reasons. But i do have few in my mind. So from today onward i'm going to work toward fixing all of the reasons one by one. The first possible reason I've is, a couple of days ago my best friend really needed my help with something. And instead of helping i was really angry with the josification(Josification is a new word, which will soon be appearing in the dictionary so you might as well get used to it. It means to procrastinate, but to a severe extent.). So now i'm in despair. And curse at my ,the then, judgement. well i just hope my friend did well without my help though. Okay so i'm going to work on this thing and update about it later. Till then i'll be as wakeful as an owl or a bat. : )

inception .3

well i'm an electronics engineer. And since i'm in my final year, I've to do this major project. Being interested in music, i thought why not incorporate that into my project. So we thought of making a audio processor using FPGA. We are trying to use digital signal processing to create affects. Echoes, bass, distortion are some of the minor affects that we plan to produce.
But then i thought, implementation of digital signal processing is really hard. And for all those music lovers we want to create their own affects, it will even be harder if they don't know what DSP is. so why not create a software where users will get to play with the parameters of the filter, change the gain coefficients, delay parameters etc. okay you might say that these kind of software already exists. But then have you ever seen a software that actually allows you to produce your own affects from the core level, like how many numbers delay stages to add, what order of filters to use, how much gain to provide, how many output channels to include, whether stereo, 5.1 surround system or even 10 channel output.
yes i think this software will really be handy to lots of musician who wants to know the maths behind the affects being produced.

inception .2

Have you ever wondered why hugs are good. well let me tell you why i think they are so cozy. It's because you get to feel that warmth of the other person. And the most important thing is that you feel their blood vessels vibrating. which gives you the sense of being cuddled by another live being.
So i was thinking why not attach a pulse sensor to mobile phones and allow the users to send their pulses via the network. And then also add the pulse simulator so that the other person can feel the exact pulse of the other person. well this can also be used to detect the feelings. your pulse rate tells a lot about how a person is feeling. so say, i'm really psyched and i want to let my best friend know, i can just give a call and let them feel my pulse.
i'd definitely buy the phone with that feature! : )

Inception. 1

Okay so, has it happened to you, that while contemplating you came up with this million dollar idea. Well am not kidding but I've had these so called epiphanies, where i might have just had a brilliant idea. An idea that might already have been thought of, implemented or maybe even in the process of being implemented. But i surely did love those eureka moments. And well i thought, i'm content with what I've so why don't i share these ideas out here.
This one goes out to the mobile service providers. As we know most of the countries in the world have prepaid cell phones. For those who don't know about prepaid phones, it's where you pay before you use the service. So i was talking to my best friend the other night over the phone. And it so happened that my balance got over. I couldn't go out to buy a recharge card in the middle of the night. So i thought i would pay double the money back when i recharged next time if i were given just another five minutes to talk. So yes this is my idea. If these cell phone companies allowed this emergency call services even after the balance got over, they could generate some extra revenues!!
Well i don't know about the legal issues concerned but i think it's pretty viable. sorry to say this but this is not in favor of the users at all. : )

Wednesday, April 18, 2012

A cushion tale!!




What will you do when the thing you avoid becomes the thing you want?  And what if the thing you want becomes the thing you need, before you even know it!  Well this is a small story I want to share with you today. This is a story about a cushion and not just an ordinary cushion it’s my cushion. I call it a cushion of hope; for now all my hope in getting what I want rests upon it.

For a past couple of months I’ve been working really hard. And every night there laid this cushion asking me to lay my head over it. It assured me that with its softness, it would perfectly cuddle the curvature of my head. It kept on begging me to just lie for a while and not think about anything else. But I couldn’t do it. I just couldn't; for I felt lots of things were at stake. I just kept avoiding its pleas. But I gave it a hope that one day, one fine day, when everything will be done; I’d come back to it and then dream like never before.  But who knew it would never happen!

As soon as I got free, I came back to my cushion only to realize that it was gone! I searched for it everywhere but in vain. I found another cushion and sadly kept my head over it. But to my dismay no sleep came to me. And here I lay all so fatigued and disappointed! I hope I’ll find my cushion someday but till then I won’t be able to dream like I used to!

Saturday, February 25, 2012

My first Microprocessor design


Specifications

1.  RAM:                                    32*8 bits of RAM
2.  Data Bus:                               8 bit
3.  User Visible registers:             A, B, C, D
4. Control and status registers:     MAR, MBR, IR, PC, TEMP
5. ALU:                                      8 bit, performs Addition, complementing and logical NAND operation
6. Flag:                                       Zero, carry

The block diagram of the microprocessor is shown below:
The microprocessor is based on RISC approach. Hence it supports minimum number of instructions.

Instruction set
Instruction is 8 bit. The first 3 bits denote the type of instruction. The last 2 bits give the register address.
The instruction set is as follows
1. SFA memory:  Store from register A to given memory address
2. STA memory: Store to register A from given memory address
3. JMP memory:  Performs unconditional jump to the given memory address
4. ADD A, R:        Performs addition between the given register and register A and stores in register A
5. CMP:                                Complements the contents of register A
6. NAND A, R:    Performs logical NAND between register A and given register contents
7. MVI A, Data:  performs immediate addressing
8. MOV A, R:      Moves the data from register A to given register

The instruction decoder and the timing generator is shown below:
The combinational logic used to generate the required signal for the different latches present in the registers, ALU was drawn based on the micro-instruction analysis. Which I’ll add shortly.

The combinational logic thus designed is as shown below:



 This is just a simple design of a microprocessor. I'm trying to understand the more complex microprocessors present in today's market. And hope fully will design an efficient design someday!  


Sunday, February 5, 2012

VHDL


 Introduction:

VHDL stands for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language. U.S. Department of Defense developed VHDL in 70’s and 80’s with ADA as its root. IEEE adopted VHDL as a standard in 1987. VHDL is now used to describe most of the digital systems. We can design hardware in a VHDL IDE, for FPGA implementation, to produce the RTL schematic of the desired circuit. Then the generated schematic can be verified using simulation software which shows the waveforms of inputs and outputs of the circuit after generating the appropriate test-bench. To generate an appropriate test-bench for a particular circuit or VHDL code, the inputs have to be defined correctly. When the VHDL model is written in FPGA, the model is transformed to actual hardwired components rather than just a programming language loaded to a processor. Hence rather than program being executed, we run the model in hardwired form.

FPGA design and programming

To define the behavior of the FPGA, we write a hardware description language (HDL) or make a schematic design. The HDL form is more suited to work with large structures because it's possible to just specify them numerically rather than having to draw every piece by hand. However, schematic entry can allow for easier visualization of a design.
Then, using an electronic design automation tool, a technology-mapped netlist is generated. The netlist can then be fitted to the actual FPGA architecture using a process called place-and-route, usually performed by the FPGA Company’s proprietary place-and-route software. The user will validate the map, place and route results via timing analysissimulation, and other verification methodologies. Once the design and validation process is complete, the binary file generated is used to (re)configure the FPGA. This file is transferred to the FPGA/CPLD via a serial interface (JTAG) or to an external memory device like an EEPROM.
Advantages of VHDL:
1.  It allows us to model the behavior of the required system and simulate it before synthesis tools   translates the design into real hardware (gates and wires).
2.  VHDL unlike most of the programming language allows us to write concurrent statements. These concurrent statements are executed in parallel. This increases the processing speed.
3. VHDL project is multipurpose. Being created once, a calculation block can be used in many other projects. However, many formational and functional block parameters can be tuned (capacity parameters, memory size, element base, block composition and interconnection structure).
4. VHDL project is portable. Being created for one element base, a computing device project can be ported on another element base, for example VLSI with various technologies.

VHDL Constructs

Entity:  An entity is the most basic building block in a design. The uppermost level of the design is the top-level entity. If the design is hierarchical, then the top-level description will have lower-level descriptions contained in it. These lower-level descriptions will be lower-level entities contained in the top-level entity description.
 Architecture:  All entities that can be simulated have an architecture description. The architecture describes the behavior of the entity. A single entity can have multiple architectures.
 Configuration:  A configuration statement is used to bind a component instance to an entity-architecture pair.
Package: A package is a collection of commonly used data types and subprograms used in a design.
Driver: This is a source on a signal. If a signal is driven by two sources, then when both sources are active, the signal will have two drivers.
Bus:  The term “bus” usually brings to mind a group of signals or a particular method of communication used in the design of hardware.
Attribute: An attribute is data that are attached to VHDL objects or predefined data about VHDL objects.
Generic: A generic is VHDL’s term for a parameter that passes information to an entity. For instance, if an entity is a gate level model with a rise and a fall delay, values for the rise and fall delays could be passed into the entity with generics.
Process: A process is the basic unit of execution in VHDL. All operations that are performed in a simulation of a VHDL description are broken into single or multiple processes.




VHDL code Structure:


VHDL code structure consists of library declarations, entity and architecture defining the behavior of the entity.
Library:  It is the collection of commonly used codes. Placing the codes inside the library allows us to frequently use them anywhere possible. The code is usually written in the form of FUNTIONS, POCEDURES, COMPONENTS, CONSTANTs or TYPES which are placed inside a PACKAGE. Library is declared using the following statement.
LIBRARY library_name;
USE library_name.package_name.package_parts;

Entity: Entity is the list of all the input output port and its specifications. It consists of the following format:

Architecture: It is a description of the behavior of the entity. Its syntax is as follows:

Saturday, January 7, 2012

The miracle of FFT


I’ve always admired discrete signals. Without them I’d not be able to write this blog and make you able to read it. But with discrete signals comes the need for a method of efficient signal processing. And that is where FFT has helped a lot. Fast Fourier transform is a method of calculating the DFT of a given signal. But the catch is that it reduces the computational step to that extent where our digital processors can easily compute.  FFT has many variations such as FFT by decimation in time, FFT by decimation in frequency etc. I’ll briefly talk about the FFT using decimation in frequency, how it works and how it helps in computation.
We know that for a discrete signal x(n) the DFT is given as,
Now in order to understand FFT we analyze the property of WN. We can easily to arrive to following results:
WNN=1
WNN/2=-1 and WNN+K= WNKNow let N be the total number of discrete data sequence and N=2L where L is an integer. Now since N is even we’ll have N/2 also even. Then we can write,

Splitting X(k) into even and odd samples we’ve

Now the beauty of the above equations is that DFT of signal with 8 samples can be calculated using 4 DFTs as shown below in the picture.
And again 2 DFT can be calculated as shown below.

Now the 8-point DFT can be computed with the following butterfly diagram.

From all these what is interesting is that for normal 8-point DFT we would require N2 complex multiplication and N(N-1) complex addition. Whereas using FFT we only require (N/2)log2N complex multiplication and Nlog2N complex addition. This is way less! Due to this FFT can be employed in Digital processors to calculate and manipulate the discrete data. I’ll talk more on this later. Ciao!

Friday, January 6, 2012

My understanding of Maxwell's Equations

Every Professor i asked, they said i should have basic understanding of the Maxwell's equation to be able to understand the propagation of waves. So I went out searching the meaning of the well known Maxwell's equation. Sure it is easy to just write the mathematical interpretation but this time i really wanted to know their physical implication as well. 
So what are Maxwell's equations, to answer this we have to be able to know certain laws. Not in any order, the first is Ampere's law. Basically what i understood is that current carrying conductor will have magnetic field around it. for a simple conductor carrying current, the direction of the magnetic field is obtained by right hand grip with thumb pointing in the direction of the current. Now conversely if we integrate the Magnetic field around the close loop we get Current.
\oint_{\partial S} \mathbf{H} \cdot \mathrm{d}\mathbf{l} = I_{f,S} + \frac {\partial \Phi_S(\mathbf D)}{\partial t}
now the second term out here we can see was added by Maxwell. This term accounts the effect of time changing displacement current. 
The second law is Faraday's. Which was little easy to understand. We know that electric potential between two point is the amount of work done in moving a unit positive charge from one point to the other against the electric field. Now If we try to find the work done in moving a charge in a loop then the total work will be zero since we end up getting at the very spot we started from. So line integral of electric field around a close loop will be equal to zero. But this is the case only for time invariant field. For time variant magnetic fields the line integral of electric field will yield the EMF. And if we take the curl of  the electric field, which is basically the measure of varying electric field, gives us rate of change of magnetic flux with time. 
\oint_{\partial S} \mathbf{E} \cdot \mathrm{d}\mathbf{l}  = - \frac {\partial \Phi_S{(\mathbf B)}}{\partial t}
the third is Gauss law. Now if D is electric flux density then it's surface integral will give us the charge enclosed itself.
 \iint_{\partial V}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\;\;\;\subset\!\supset \mathbf D\;\cdot\mathrm{d}\mathbf A = Q_{f}(V)
And the fourth law is of Gauss too but for magnetic fields. Since magnetic field always follow a close loop. and there hasn't been any discovery of magnetic mono-pole the interpretation of this equation was self evident.
\iint_{\partial V}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\;\;\;\subset\!\supset \mathbf B\;\cdot\mathrm{d}\mathbf A = 0

So far i've gained little idea about the equations and am still striving to have a deeper understanding regarding the implications. The equations written above are in integral form. The differential form of the Maxwell equations were yet simpler to analyze apart from few, by few i meant all four of them.
The differential form of ampere was that curl of magnetic field gave current density and time-changing displacement current. I've been trying to imagine this in my mind for a long time. Curl has always daunted me in calculations, not mathematically but rather with it's physical interpretation.  What I've been able to analyze so far is that, when we analyze the time variant magnetic field, it will produce the curl in the perpendicular direction of it's flow. And this curl will be J, current density as curling magnetic field always indicate presence of current. 
Differential form of Faraday's law states that curl of electric field will yield time-changing magnetic flux density. this one is still in the process of being imagined. As changing electric field will certainly produce changing current and changing current will always have changing magnetic field around it.
Gauss law for electric field in differential form was easy to analyze as divergence of electric flux density, which is the measure of outflow-inflow, gives charge density.
And the differential form of Gauss law for magnetic fields states that divergence of magnetic flux density is equal to zero as magnetic field through a closed surface will always have equal inflow and outflow.
\nabla \cdot \mathbf{D} = \rho_f
\nabla \cdot \mathbf{B} = 0
\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}} {\partial t}
\nabla \times \mathbf{H} = \mathbf{J}_f + \frac{\partial \mathbf{D}} {\partial t}
So these are the Maxwell equations. I still have a lot of way to go before fulling understanding them. Never stop learning!