Sunday, November 19, 2006

Human brain vs Computer

A lotta people have tried to model the computer as a human brain. I thought I should just try the reverse. Well I will just try to put down some analogies.


OS does process scheduling - human brain also does scheduling.. Those who have hajaar concentration are actually able to disable context switches. Perhaps it is possible to do this by disabling interrupts. But then disabling of interrupts is a privileged instruction and it should be possible only for the kernel to use it. So the kernel up their brains is insecure. Haha. The programs that run on their brains are somewhat like some hacker's code on a comp which could possibly disable interrupts and then use the complete processing power of the processor. But then, what the hacker program does is typically considered as useless work (possibly harmful), but the equivalent work on the human brain is considered as useful. Maybe we need to change our notion of usefulness to something more consistent across the platform....

Context switches in comps take approximately constant time. But in the human brain, a context switch to do something utterly 'useless' has switch time tending to zero if you have been doing something 'useful'. And if you are just whiling away time, the context switch time required to switch to a 'more useful' task seems to approach infinity. Strange.....

Just like the comp, the human brain also has memory hierarchies. At the most basic level, there is the RAM and hard disk on the comp. Similarly the brain also has short term and long term memory. We need to spend some time in recollecting old events etc, just like paging in pages from the hard disk to RAM. It would be interesting to find out what sort of replacement algorithm is followed in the brain..... Perhaps the brain also has other levels of hierarchy similar to the different levels of cache in the comp, we might just be unaware of them or rather not tried to model the brain with that many levels of memory hierarchy.

The Spinal cord is very much an equivalent of the FSB. It provides the link between the processor and all the peripheral organs (devices).

Saturday, November 04, 2006

Life is full of surprises

A few weeks back, after those 3 consecutive night outs, I thought things can't get any worse. But the beauty of life is that it always manages to prove you wrong. This year I had the worst Diwali of my life. I had to submit a Compilers assignment on Diwali...

Diwali was on a Saturday. From Friday night till Saturday afternoon I spent the entire time in the Lab trying to finish the assignment. This was after a night out the previous day working on the same assignment. The only period for which I came out from Lab was for having breakfast and even that was not a smooth affair. When I came out of the Lab at seven in the morning, it was bright outside. I decided to go for breakfast and then come back later to continue with the assignment. As soon as I left the dept, it became quite dark and started raining. By the time I reached the hostel, I was completely drenched. It was pouring so badly that I could not even leave the hostel and go to the mess for a while. After about an hour, when the rain had subceeded, I had breakfast and went back to lab.

Finally I managed to finish the assignment and submitted the same by two in the afternoon. Well things would have been fine if that was the only assignment. On Monday I had to submit another OS Lab assignment which required a lot of work. There was no way I could have finished it even if I had put night outs on Saturday as well as Sunday. So I just read up the project description for OS lab and then decided sleep for a while in the evening.

I was so tired that I slept much longer than I had intended to. Others in the hostel were enjoying outside and were bursting crackers etc. Amidst all the noise of crackers, I slept like a log. Finally I woke up at 9 in the night.
Damn!! I had missed dinner also...

Anyway there was nothing much I could do now.. So I went to Coffee day (Oh yeah, a new Coffee day outlet has been opened in IIT) . That was the only eatery that was open in IIT on Diwali. After that I went back to lab to start off on the OS assignment.

On Monday, most of the groups had not finished the OS assignment and so the deadline was postponed. Eventually, since the TA for course was not free whenever we wanted to show it, it kept getting postponed. And I am now in the lab waiting to submit the same OS assignment for which I have been putting fight since Diwali.

Update : Looks like there will be another extension. My partner for the OS assignment is unfortunately ill and has been admitted to hospital. And after such a long wait, the TA told me to submit it after my partner is back...