New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Embedded Systems Week 1 Notes

by: Anudeep Gavini

Embedded Systems Week 1 Notes ECE

Marketplace > Cornell University > ECE > Embedded Systems Week 1 Notes
Anudeep Gavini
View Full Document for 0 Karma

View Full Document


Unlock These Notes for FREE

Enter your email below and we will instantly email you these Notes for Embedded Systems

(Limited time offer)

Unlock Notes

Already have a StudySoup account? Login here

Unlock FREE Class Notes

Enter your email below to receive Embedded Systems notes

Everyone needs better class notes. Enter your email and we will send you notes for this class for free.

Unlock FREE notes

About this Document

Introduction What is Assembly?
Embedded Systems
Professor Jose F. Martinez
Class Notes




Popular in Embedded Systems

Popular in Department

This 5 page Class Notes was uploaded by Anudeep Gavini on Sunday February 7, 2016. The Class Notes belongs to ECE at Cornell University taught by Professor Jose F. Martinez in Winter 2016. Since its upload, it has received 153 views.


Reviews for Embedded Systems Week 1 Notes


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 02/07/16
Introduction to Assembly 1 What is Assembly? ▯ Assembly is a human readable translation of machine code. ▯ Machine code is the instructions send to a processor. It is encoded in binary. 2 Ok, how does a processor work? ▯ 1: It fetches the next instruction from memory ▯ 2: It decodes the instruction from binary to an action ▯ 3: Executes the action ▯ Rinse and Repeat ▯ For example: { Lets assume that we have a processor with: 16 instructions, 8 regis- ters, and it places the result of an operation into the same register as the source data. { Let us take 2 instructions: 1101010100, and 1001111111. ▯ In both instructions, the ▯rst four bits from the left are the operation code. ▯ In instruction 1, the next 3 bits is the ▯rst source (and only destination) register. The 3 bits after that is the second source register. ▯ In instruction 2, the last 6 bits is the o▯set value - since we are in 2’s complement, 111111 is the binary equivalent of -1. { Instruction 1 stores the result of src1▯src2 in src1, and checks if the result is 0, storing the result in the Z ag. As with every instruction, the program counter is incremented as well. { Instruction 2 checks if the Z ag is 1 or 0; if it is one, it steps to the next instruction in the set.If it is 0, it adds the o▯set (-1) to the program counter, e▯ectively stepping back to the previous instruciton. 1 { Translated to assembly, these instructions would be SUB R2 R4, and BNZ hlabeli. { SUB is the subtract instruction, R2 and R4 are the registers to draw data from. In this case, the instruction will also store the result in R2. { BNZ is the branch operation, and instructs the processor to move the labeled section of the instruction set if the Z ag is not 0. The o▯set necessary to move to that labeled branch is calculated when translating from Assembly to machine code. 3 Alright, so who even uses assembly language? ▯ Considering how painful it can be, masochists. ▯ Also since it’s required, students taking this class. ▯ Seriously, why not just use a compiler or an interpreter? ▯ They do a good job of making good machine code from say, C or Python. { It’s not good enough though - they tend to add every single library into the resulting executable, which bloats its size to levels that really are ine▯cient for a small embedded system. { They’re also not as fast as possible all the time - they cannot always reduce overhead of critical code enough to make it useful. { Need assembly here to make take more control and make code as streamlined as possible. 4 Fine, so why study Assembly? ▯ It helps you understand the interaction between hardware and software on a deeper level ▯ Makes you consider what functionality the hardware actually provides ▯ Question how languages are supported on hardware. How do we handle recursion? Function calls? ▯ How do we e▯ciently handle system services like dynamic allocation? What about input and output devices? ▯ Mainly, assembly is the language we need to write code that is lean, clean, and FAST. 2 5 What is an instruction set? How do they work? ▯ An instruction set is a contract between the hardware and software. ▯ This essentially says that the hardware can handle the instructions given to it in any way it wants, as long as the software can’t tell the di▯erence. ▯ For example, we can perform some high-performance trickery such as out- of-order execution to speed up processing. Or maybe we can switch to a better processor that uses, say less power, or has better performance, or maybe both. ▯ Despite these changes, HOW we write code doesn’t change! A machine code instruction on one processor should work on another from the same family. ▯ This also means that software can use any syntax it wants, as long as it can be successfully translated to machine code! ▯ The general instruction format is made up of an Operation code, a desti- nation register, and two source registers. ▯ there can be small di▯erences - no destination, or no second source, or a constant value rather than a second source. ▯ The speci▯cation for the ARM cortex M that we will use in class is as follows: { 32 bit datapath - we can send up to 32 bits along the wires. { 32 bit addressing space { Thumb ISA - most instructions can be worded in 16 bits, though we have up to 32 bits for some extra functionality. 3 ECE 3140/CS 3420 Notes - 2/02/16 February 7, 2016 1 What is an embedded system? ▯ At it’s core, its a simpli▯ed computer, with a few di▯erences. { Main di▯erence is that an embedded system has a direct connection to the real world. { it uses sensors to capture data and information about the world { it also has an output that acts directly on something in the world. ▯ it has the following features: { Time constraints - everything from gathering data to acting on it has to be done in a very short amount of time. For example, sensing when to deploy an airbag, and sending a signal to the system to perform that action. { Limited functionality - it does one job quickly and e▯ciently. This helps keep the systems small, keeps the costs down, and increases reliability. { A limited number of resources. ▯ The system we will be using in class is the FRDM-K64F. 2 Topics ▯ Assembly language. This is a human readable translation of the instruc- tions passed to the chips in an embedded system. Lab 1 will focus on this. ▯ Interrupts and input/output. Lab 2 will focus on these topics. ▯ Concurrency. This will also include making models, handling multiple threads, and synchronization. Labs 3 and 4 will cover these topics. ▯ Time constraints and task scheduling. This is the focus of Lab 5. ▯ Communication between systems. This will be the focus of lab 6. ▯ Converting data 1 3 Outcomes ▯ Understand why we use assembly, and how it works with higher level languages such as C and Python. ▯ How do processors interact with the world? ▯ Reason about and apply concurrent thinking to an embedded system. ▯ Process scheduling and scheduled tasks in real time. ▯ Learn the concepts of agile programming ▯ Be able to write and articulate our technical reasoning ▯ Provide and recieve constructive feedback 2


Buy Material

Are you sure you want to buy this material for

0 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.