Archive for the ‘Philosophy’ Category

Area vs Time: A look at algorithmic complexity in Hardware and Software

Many of us would have studied in our college that implementing something in hardware will be faster than implementing the same in software. What i see from this situation is a time complexity being converted into area complexity. And the benefits provided by pipelining, and reduced control overhead resulting from special purpose control implementation (As opposed to more generic&bulky control logic required by a general purpose CPU).

My own recent expeditions in this area suggest something that is not so obvious. The inverse proportion between Logic Area and Time starts after a discontinuity. Some algorithms will benefit substantially if a very minimal part of the algorithm is implemented in hardware. Beyond that point the Area vs Time relation will be an inverse proportional relation.

I would call these minimal logic that brings in huge value add as a ‘primitive function’. Now a little bit of theory. A general purpose processor does some sort of data manipulation function (eg. add, subract, multiply, divide, compare shift etc..) between two registers. Basically for a simple RISC 32 bit processor, whose instruction set is capable of taking 2 32 bit register operands and producing 1 32 bit register output, there is some combinational logic between the 64bit input and 32 bit output, depending on the current instruction. The typical instruction set of a RISC is <256 instruction. Is this enough to do all the possible function mapping from a 64 bit input to a 32 bit output domain?. No certainly not. You can always have one function that mirrors one of the 32 bit input to the output.

So for any of the general purpose processors, it is not possible to implement all the possible function mapping from a 2 word space to a 1 word symbol space. Instead it just implements the most commonly used function mappings like add, subtract, boolean operators, shifts etc. If you take the case of mirroring of bits in a 32 bit word, it will sure take at-least 32 cycles to do it in a general purpose CPU. But implementing a mirroring in hardware doesn’t consume much logic. But instantly reduces the time required for computation of the mirror by a large amount.

So if you are tasked with implementing custom hardware constrained by area, the first thing to ask is: is my CPU capable of supporting all the primitive logic function, relevant for the algorithms in use.

TODO: To be updated with some rough sketches indicating my idea

Categories: Philosophy, Tech, Viewpoints Tags:


February 12, 2015 Leave a comment

If you go sit beneath a coconut tree to escape from the hot sun, and then you fall asleep in the shades of the tree; and then if by chance a ripe coconut falls on your head, killing you, will that be called your fate?

But there exists a certain wisdom that allows you to choose a tree with a lower chance of fatal accidents. Of-course, I don’t believe you can always make the probability zero. There exists a non-zero chance that a rock from Mars or an aeroplane engine falls on this particular tree taking away your life or perhaps wiping away all life forms from earth. You can further reduce the chance, if you actively track all the inter planetary objects heading to earth :-D.

Moral is that though life is full of chance events, there exists a certain wisdom in each case to bend the chance to your favour. But remember that however you reduce the probability of the worse; as long as it is non-zero, there is a chance!

Categories: Philosophy

On the human need for happiness

January 4, 2015 Leave a comment

Life seems like a never-ending pursuit for happiness. Modern man never finds it happy in a steady state no matter how good the state is. Seems it is very important for the existence that there is always something that worries him. He always want something to be pursued, something to worry about..

Let me make myself clear what I mean by happiness. I am not referring to the short lived bliss that you get when you listen to a great piece of music, or enjoying a great piece of art. Rather I am considering the overall state of mind over a longer period of time, – say a month. Such overall feelings will surely be the result of thought that are persistent.

May be everyone ‘happy’ must be worrying about something. And I don;t think the unhappy mind doesn’t have any worry either. So everyone has something to worry. The things that keeps one worrying about should be the ones that determine greatness from mediocrity. (Greatness and mediocrity when measured by the contributions to the society.)

Other animals should be happy once their fundamental physical needs and emotional needs are satisfied. So what makes us go beyond the others. Is it something social? Is it something to do with our ability to think with language? Is it the unique identity, and a need to be unique; that the society instills in us through the many examples in history, and of own lineage that makes us want to be unique? What exactly is the fuel for the pursuit for happiness?

Is there a difference in the attitudes of various cultures in this regard? Is there a difference in terms of age? Is it really necessary to have a purpose in life?

Looking back

The second one-third of life; one with a different set of responsibilities and difficulties. To me it feels like the first one-third passed by too fast. More so will be the case with the second third; as in the corporate world, we have only 8-10hrs less in our personal life; and that too – highly fragmented!

Life is too short. Before we realise, we all get old. Looking back, the only significant things probably will be the dreams that we have pursued..

Categories: Philosophy