Archive for June 2015

Microprocessor Design – managing a lifetime of work each second

June 30, 2015

In a series of lab projects, my partner and I completed the design of a pipelined processor and memory system.  No, we didn’t connect every wire in the microchip by hand.  We designed the system with a hardware language that recreates the microprocessor on an FPGA.  [Field-programmable gate array is a microchip with programmable fabric that can be continually redesigned into new microchips.  More on this in a later post…]

The microprocessor chip is the heart of any computer.  It’s the workhorse that grabs data, performs logic on it, and spits out the new data to where it belongs.  One factor that determines computation power is the speed/frequency of its processor.  The computer I’m typing on uses an Intel i5 Processor at 1.8 GHz.  That means every second, it can perform 1.8 billion cycles of computer busywork.

Estimating the average human’s cardiac cycles over a 60-year lifetime: a person will experience (60 heartbeats per minute)*(1440 minutes per day)*(365 days per year)*(60 years) = 1.89 billion heartbeats.  In essence, computers can do great things mostly because humans designed them to manage a lifetime of busywork in each second.

New skills:  Processor design in Verilog code using Xilinx ISE synthesis and analysis tools.

Key Takeaway:  Forget final exam scores; a class should be measured by the number of times a student is stunned with realization, making him see the world a little differently.  For me, this was such a course:  where the perfect blend of lectures, assigned reading, homework problems, and final design project blended perfectly into a world-expanding experience.

Screen Shot 2015-06-30 at 7.33.47 PM

My handwritten diagram of our cache system! Caches store recently used (or spatially close) data for easy-access because the processor is likely to use that data again. Similar to why a browser’s cache will locally store website elements that you commonly visit, so the browser doesn’t have to re-download them over the Internet every time.

Learning Precision

June 30, 2015

As much as I enjoyed my electronics, physics, and humanities courses; my favorite class in my first-year…

… was still CALCULUS!

It was a year-long series of courses that taught linear algebra, multivariable calculus, vector calculus, and differential equations.  My absolute favorite topic was vector calculus, where operations and theorems are used to compute 3d vector fields.  This can be visualized as a collection of arrows in space, like an electromagnetic field or a gravitational force.

New skills:

  • Computing with Precision.  Though my calculus tools and intuition have atrophied over time, computing with an attention to detail never goes out of style.
  • Communication with Precision.  I couldn’t get through this course by myself and working with peers late into the night, carefully stepping through pages of integration or proofs forced me to communicate with a precision never-before required.

Next Questions:  Where do these models and techniques manifest themselves in engineering?  [I would soon find out: in many places.  Particularly in an Electromagnetic course that zapped away any nostalgia I still had towards Vector Calculus]

Key Takeaway:  We learned that when a problem seems intractable, usually a change of perspective (…or in our case a change of coordinate systems) is needed.  And after that simplification, you realize you’re just integrating Pringles.

hyperpara

I vividly recall intimidating problems requiring triple integrals to calculate the area and volume associated with hyperbolic paraboloids.

Arduino Music Box

June 30, 2015

In my first year, I took an introductory electronics course that gave us access to

  • analog circuits:  circuits are closed loops featuring electronic components (such as resistors, transistors, LEDs, transistors, amplifiers);  there’s also a power source that raises the voltage, pumps current, putting all the components in action.
  • sensors:  interactive devices (such as buttons, wheels, temperature sensor etc. ) that can sense their surroundings
  • microcrontrollers:  named ‘micro’ because they are small, simple, cheap computers; ‘controller’ because they are mainly are used to run simple logic to control other devices.  Though it can execute code like any computer, it doesn’t have the computing power to run your laptop or phone.

After training us with all these parts and more, we were then let loose to build our own final project.  I had the most fun running simple code on an Arduino Nano microcrontroller.    Using an empty cigar box, I made a music box that plays mp3s from an SD card and displays its song name on a tiny screen.

This was filmed in 2011 when my phone was technologically more similar to a potato than a modern smartphone.

New skills:

  • First time constructing non-trivial circuits and using equations like Ohm’s Law in real life instead in a notebook.
  • C++ programming in using Arduino Integrated Development Environment (IDE) which runs the code.

Followup Questions:  How does the microcontroller work?  How did it interpret the mp3 file and decode into playable sounds? How to organize circuit wirings so it’s not a hot mess?

Key Takeaway:  An auspicious introduction to electronics where I quickly learned that digital domain (running code on microcrontroller) is friendlier than analog domain (soldering little wires and devices together and measuring with oscilloscope).

In retrospect, this key takeaway became a catalyst for a lot of other things.  First impressions DO count!