Category Archives: http://schemas.google.com/blogger/2008/kind#post

Parallel Computing



“Parallel computing is a method of computation in which multiple calculations are carried out simultaneously” (Wikipedia). Although parallel computing was initially restricted to high performance computing, physical constraints like heat dissipation has meant that the interest in parallel computing is now across all computing disciplines including personal and mobile computing.


By parallelizing the computation, it is expected that the workload on any given processing unit is smaller thus avoiding hitting physical constraints in processors architectures. Also by employing multiple processors for the same job, it is also expected that the job gets completed quicker. However the benefit of parallel execution on execution speed is constraints by Amdhals law. Amdhals law states that the “Speedup of a program using multiple processors is limited by the time needed for the sequential fraction of the programme” (Wikipedia). This law is quite important for the industry to realise that not all the problems are benefited by solving them under parallel computations.






Computing parallelism is achieved at different levels starting at bit level and going on to instruction level, processor core level and machine level. Bit level parallelism is easily identifiable by the existence of 32 bit and 64 bit operating systems. Increase in bit level parallelism enables the processor to complete computations with less number of instructions.

On the other hand instruction level parallelism enables the processor to have a larger instruction pipeline. A larger instruction pipeline will mean that at any given moment the processor can process multiple instructions that require different kinds of operations.

When computer processors reached speeds closed to 3GHz, it started getting close to physical limitations, specially respect to unmanageable heat dissipation. Rather than trying to increase the frequency of a single processor the industry came up with the multi-core processor design where each processor runs close to 2.5GHz. There are designs that also treat the graphical processing unit (GPU) as an additional processor thus increasing the internal computer parallelism even more. These innovations have begun to reach mobile devices as well (Most new smart phones have multi-core processors)

There is also multiple method of parallel computing achieved by combining large number of computing units (machines, processors etc…) together. Distributed computing, cluster computing, massively parallel computing (MPP) or grid computing are some of these where each one differs from the other based on their architectural differences.


Google is a great example of huge commercial cluster computing unit. Although its details are not publicly available information it’s one of the largest ISPs in the world. The beauty of its cluster is the usage of general purpose Linux computers to cater for ~60k search queries Google gets each second (http://www.statisticbrain.com/google-searches/). Most of the large social computing platforms like Facebook and Twitter are using the same technique to cater increasingly large amount of computation they have to perform.

Parallel computing challenges computers scientists with a different set of problems like state management, race conditions and orchestration. It’s also generally accepted the programming for parallelism is harder and less efficient than sequential programmes, although this could well be due to the fact that current programming landscape is built on years of development in sequential thinking. Programming languages like Scala, F# and Haskell are working hard to make programming for parallelism more intuitive and productive.

Parallel computing may well have more innovation in the pipeline and holds a huge promise towards the evolution of computing in general. It has contributed immensely to both hardware engineering (Processor manufacturing, networks) and software engineering practices.

Mobile Computing

If you haven’t read my previous article about internet and Pc, please read it here.
(Image retrieved from: http://www.globalgrind.com)

Wikipedia defines Mobile Computing as “Human Computer Interaction by which the computer is expected to be transported during normal usage”. While the PC started taking computing machines to everyday consumer, mobile computing has really infiltrated average consumer market and revolutionized computing as a whole. Mobile computing is spreading faster than any other consumer technology in history. It has opened up new possibilities for human interaction by enabling the continuation of the computing experience regardless of geographical location. Smart phones have revolutionized not just computing but society as a whole since it’s ability to connect people in a very convenient and personal way.

Mobile computing is mainly delivered at present via smart phones and tablets; however it applies equally to PDAs, in vehicle computers, electronic readers, wearable computers etc…At present the mobile computing market is divided in to 3 main platforms namely Apple iOS, Google Android and Microsoft Windows.

Innovation in mobile computing can be categorised in to hardware, software and process. Hardware innovations can be seen around areas such as device power management, touch screens, material design for portability etc… An everyday smart watch at present is deemed to packs more computing power than the super computers that took Apollo 11 to the moon. This feat is mainly due to innovations in engineering practices such as materials, electronics and design powered by sheer competitive nature of the market. Devices on the brink of mass scale usage such as Google Glass and Agent smart watch will continue to expand the boundaries of mobile hardware technologies.

Although initial focus on mobile computing was mainly around its hardware, an increasing amount of attention is give to Software. Whole new software areas like mobile apps, location aware programming, and inter-device communication are developing every day thanks to the population of mobile computing. The open nature of the platforms enabling anyone with right skills to build and distribute software for mobile devices has feed the exponential adaptation of mobile computing among general public. 

Another aspect of mobile computing is its contributions to engineering and management practices such as industrial design, supply chain management and mass scale production/distribution. Global companies like Apple or Samsung are heavily dependent on a highly optimized and synchronized set of engineering and management processes to churn out quality devices in millions each day.

 Mobile computing posses its own engineering and social challenges like security, privacy, inconsistent connectivity, potential health hazards and quality of interaction. Regardless of these challenges mobile computing is expected to play a major role in the future of computing.

Building a simple  counter using Arduino uno

                                           Figure 1
Counter circuits are one of the most common uses of digital electronics in our daily life. A digital counter  is a system that is designed to perform counting from a given number to a specified value.(in general case 0 to any arbitrary number.)You don’t need an Ardunio board or any other microcontroller to build a counter  but using Ardunio ,we can simplify our task and we can do changes to our design very easily. In this article I’m hoping  to give a small introduction to sequential systems as well.
Counter s are categorized under a family called sequential systems. In electronics there are two kinds of systems .
Ø  Combinational systems
Ø  Sequential systems
The key difference between these two systems are sequential systems’ output depend on the previous output as well as the inputs and combinational systems’ output depend only on it’s inputs. Another key difference is that the sequential systems will typically have a clock. Clock is an essential part of sequential design and it’s the thing that defines the present and previous state.
                                                                  
Figure2

State Diagram 

State diagrams are used to describe a sequential system. It describes how the transition from one state to another state occur and the inputs (inputs of the system as well as the previous state) that triggers the transition.There are 2 kinds of FSM(finite state machines)
  •          Moore state machine -sequential systems which output depend only on states.
  •          Mealy state machine – Sequential systems which output depend on states as well as inputs of       the system.

         Counters are Moore machines since it’s output(the corresponding number to each state) only depends on states,there are no inputs to the system.   

Figure <!–[if supportFields]> SEQ Figure \* ARABIC <![endif]–>3<!–[if supportFields]><![endif]–>-State diagram of a 0 to 9 counter

Coding

The following code was used to implement the counter .The reference code is just there for help in writing code since this code is long, coder can just copy and paste and change that piece of code as required to generate the output. I have used a conventional common cathode 7 segment display so there may be a possibility that other 7segments may have different pin configuration.
There are few tricks that I’ve used to simplify coding.
·         I used a for loop to declare the output pins.(you have 7 pins to declare.)
All of them are digital output pins of Arduino .
·         I declared a constant called del to store the delay value in ms . This is very helpful when we want to change the delay time.(That’s the time interval the counter going to stay in each state.)

  The best advantage of implementing circuits using arduino is these circuits can be improved or changed at any stage.if the circuit is built from scratch it is very difficult even to add a small change.but using Arduino you only have to change the code.So it’s very convenient if you are intending to do experiments with your design.
You can download my version of this design(source code and Ardunio source code) by Here  

Paradoxes and us(part 2)

Here are the next 3 paradoxes I have mentioned in my previous post.If you didn’t read it please do it before you continue.

   4. Infinity hotel paradox

Infinity is full of paradoxes and could drive a man to madness!!Infinity is one of the most philosophical idea among  other similar ideas and it’s clearly integrated with our view of the universe. This idea is used in almost every science and philosophy yet it’s one of the hardest concept to grasp. I think mathematics(and physics) are the  only subjects that were able to surrender this mysterious entity and it has become an essential concept when we do maths or physics.
When I think about this paradox ,the only thing I have trouble to understand is that  how can a hotel with infinity  rooms can be filled? Other arguments that build upon this could be true, at least I think it has to be true but this rooms filled with infinity number of guests are really gives me a headache. but the arguments that are based on this is really mind blowing and put our imagination to it’s limits. If you are really interested in infinity try this BBC documentary(http://www.youtube.com/watch?v=NtMwAUaftSU) about the concept of infinity.(warning: this documentary may cause you dizziness or headaches JJ.)
I believe that Infinity is a concept that never be understood by  finite minds like  us and it’s an evidence of our ignorance no matter how smart we are. If you think you are smart, just try to understand how can there  be different sizes of infinities when each one is infinite. It is really deserves to be called as the king of all paradoxes.

5.The twin paradox

The twin paradox is a good example of discovering of some useful knowledge using paradoxes. Paradoxes are normally dead ends but this has given us more clear view of the true nature time and space. Even though it’s obvious that the rate of the  time flow differs from  observer to another yet it’s very hard to starting to believe this idea because we can’t this effect in our day to day chores. It’s the cleverness of Einstein to come to such a controversial conclusion just using his theories and logics while I’m sure even himself was amazed of what he has discovered. according to Einstein ,speed is not the only one that effects the rate of time flow, gravity effects time. Scientists did experiments and proved that time slows down near to a gravitational field and they take this effect into account when they design space journeys. This time dilation concept once again arouse the potentiality of time travel but no one knows how it happens.(Einstein’s theories do not reject time travel and his theories consider time as another dimension just like other 3 and there is nothing that stopping us travelling along that dimension.)

6. Schrodinger’s Cat

This is one of the first paradox I came across when I was at school and I had no idea even after I read the article about this several times. You also shouldn’t shame of yourselves if you couldn’t understand or give an explanation to this unusual phenomena because even the pioneers of quantum physics don’t have any explanation what’s going on.Once the famous scientist and the father of quantum physics Neil Bhor said” Anyone who says that he has understood quantum mechanics has not understood it.”It shows that incomplete understanding is a part of quantum mechanics .  although scientists can use quantum mechanics in their tasks in a very good manner nobody can’t give an satisfactory interpretation why sub atomic world and it’s members behave very strangely .It’s the real mystery here. The origin of this paradox is the famous and most fascinating experiment (according to meJ) double slit experiment which demonstrates the particle-Wave duality. In very small scale the world/things we know become very weird and our language(and our way of thinking) is very inefficient to explain these phenomena. The cat experiment is also something like that although it helps to get some idea about what’s going on it’s not completely capable of illustrating the true nature of nature.
Schrodinger’s thought experiment shows us something strange .If classical entities (like cats, humans, rocks etc..) can be at superposition what does it really implies? someone like Einstein would say it’s not possible at all. A quantum physicist will say although classical objects may act like particles it’s irrelevant or negligible in our world but some scientists might say a very strange thing. This duality is caused by parallel universe. It may sound like crazy but I think it’s no more crazier than saying the cat is both dead and live same time.The interpretation for this thought experiment from that parallel universe team is the experiment creates two universes that in one the cat is dead and in the other it is alive .we only can’t observe both only the one that happens in our reality. But I think this idea is conflicting the basic idea of pure randomness in quantum physics. Anyway, If you are interested in these ideas I mentioned above try this BBC documentary BBC documentary(http://www.youtube.com/watch?v=2Ds47ozzSrU) about the nature of reality .          

         

 

Paradoxes and us

                                 
Humans don’t like paradoxes .They make us uncomfortable and doubt about the knowledge we create , but paradoxes have been among us since people began to think about and make theories about our nature and universe. Some scientist like Albert Einstein believed that it’s a misunderstanding of nature but in the other hand his colleagues like Neil Bhor believed it’s a part of the nature. I think there is no single field that doesn’t have paradoxes in its domain and actually sometimes these mysterious entities help us to think more deeply and outside of the box and discover more fascinating and useful knowledge.
I found this very interesting video on YouTube and it tells us about some of the famous paradoxes in physics, maths and computer science in very interesting manner. (I couldn’t stop laughing when I watch this video because of the way the speaker presents these ideas.)so please have a look at the following video before continuing .(I guarantee you will enjoy this very much.)

1.Zeno’s paradox

Zeno’s paradox could be one of the oldest among its kind, yet it’s still very fascinating to think about the distance problem like Zeno. I always get amazed when I realized that there are infinitely many natural numbers between just 0 and 1.although we can clearly see definite length yet that space can be divided into infinitely many constituents. It’s very hard to grasp but it is what it is!!!.there are quite number of instances that we can see where one of the property of an object becomes infinite while other one remains finite.(I know only  few  which I came across in maths and physics.)
·         In Gabriel’s horn the volume of the horn reaches to a limit  while it’s surface area became a infinite value .(if u solve the integrations below you will be able see this to your self.)

( Image retrieved from http://www.rhurrell.com/gabriel.html )

·         In mathematics there is a fractal called “Koch Snowflake” which first discovered by Helge Von Koch .The speciality of this fractal is that it has an infinite length but a finite surface area.

These are some of my favourite things in this subject and I think these concepts challenge our common sense every time we stare at them.These things make us very uncomfortable about thinking them.How can be a volume of an object is finite while it’s surface area is not.The easiest answer to this would be simply they are purely mathematical objects but even still it’s very hard for us to believe it.

2.The grandfather paradox

                Every time i hear this story the first thing that comes to my mind is what happens if the time traveller goes back in time and killed the very first human beings on earth.if the grandfather paradox is true, then all the human race should wipe out from earth but there is another possibility that it might be a beginning of a new history,an alternative one. still no one has no idea what might true but I would like to go with the second possibility more than 1st one. I’m a believer in the parallel universe or rather alternative realities idea (this is my personal opinion only) and in this paradoxes are  not  mind boggling ideas but a normal phenomena. In brief, parallel universe idea says that every time we make a choice a new reality will occur that slightly different from our one.So there is no effect  from what we change in our current timeline. So no matter how much time you travel back in time and kill your ancestors, you will exist and some other reality you will not. As well as this We all have instances  in our lives that we want to change but don’t worry somewhere in this space-time some other form of yourself is going to make that choice live with that. So be happy at least someone like you had made that decision that you couldn’t .I’ll talk more about this in the last section.  

3.The Chinese room

Well this is the first instance I’ve heard of this paradox and it seems it’s rather unfair to think that machines can’t be intelligence just because they can’t speak a language besides I don’t see any reason to categorize this idea as a paradox. It’s just an opinion of some person.
Personally I believe that artificial intelligence isn’t a science fiction. even today some machines (or softwares )are able to behave like human beings ,that are similar to thinking or rather logical reasoning. But the intelligence we expecting from AI machines are much much complex and diverse than just logical reasoning. As humans we use both logical reasoning and just our instinct for our survival  and it’s obvious that logical reasoning is very helpful when the number of unknowns(or variables)are few and clearly visible but most of the time it’s our natural instinct or rather illogical approach to a problem helps us to solve our problems where the number of unknowns are very large or hidden from us.   It’s something that even humans don’t fully understand the mechanism behind it. So how can we give this gift to robots ?When we think about the intelligence  the next most important thing is conciseness that humans have about themselves as well as the world around them. I think this is the hardest part of AI engineering as we have very little knowledge it’s nature and the difficulty to model these using the knowledge we have. So even if we are long way from creating the next intelligent being on earth I hope there will be an end to this road. I have to say this topic is very interesting one and sometimes it seems more philosophical than scientific.  

I’ll tell more about the other 3 paradoxes in my next post.Please feel free to let me know your ideas by comments.