top of page
Girl with Tablet

Arm assembly language for the newbies

Day 2: Converting high level language to low level language

​

​
Building a Robot: From Idea to Action

Imagine you're building a robot. How do your high-level ideas turn into its precise movements? Let's take a visual journey through the code conversion process, step-by-step:

1. Your Idea: The Blueprint (High-Level Language)

​

You have a brilliant idea for your robot - maybe it picks up blocks or dances to music. You jot down this concept in plain English, like a script for your robot's performance. This is your high-level language, where you focus on what you want the robot to achieve.

2. Breaking it Down: The Stagehand (Compiler)

Enter the compiler, your tireless backstage helper. It analyzes your script, breaking it down into smaller, actionable steps. Think of it as dissecting the play into scenes and individual tasks for the robot to perform.

3. Detailed Instructions: The Director's Guide (Assembly Language)

​

Based on the script breakdown, the compiler creates a more detailed plan for the robot - assembly language. This code specifies exact commands for each movement, like extending the arm, grabbing an object, or adjusting its balance. Imagine it as a director's storyboard, outlining every move on stage.

4. Binary Ballet: The Language of Movement (Machine Code)

​

Finally, the assembler takes the assembly language and translates it into the robot's native language - machine code. This binary code uses 0s and 1s like a series of tiny clicks and whirs, telling the robot's motors, sensors, and other parts exactly when and how to move. It's like the actors memorizing their lines and movements to bring the robot's performance to life!

From Thought to Action:

With each step, your high-level idea is transformed into precise instructions that the robot can understand. Just like a well-rehearsed play, the compiler, assembler, and machine code work together seamlessly to turn your creative spark into a dancing, block-grabbing reality!

​

​

Now Let's delve deeper into the conversion process with a concrete example:

Idea: We want our robot to pick up a red block from the table and place it in a blue bin.

1. High-Level Language - Python:

​

​

2. Compiler:

The compiler analyzes the code, figuring out how to achieve each step. It might generate an intermediate representation also. 
 

3. Assembly Language:

Now, the compiler translates the intermediate code into assembly instructions specific to the robot's processor. For example:

4. Machine Code:

Finally, the assembler converts the assembly code into binary machine code the robot understands. The exact format will depend on the specific processor, but it might look like:

Now that we understand how high level languages are converted to low level languages like machine languages, let's dive deeper in the next tutorial. 

bottom of page