Context

Programs perform a sequence of operations on data to create some result. Everything ultimately becomes binary on the computer. However, we typically think in decimal. In C, we must tell the program how to encode the data when we declare a variable. This will determine the binary pattern used to represent the data in memory. This will also change how operations are performed on the data. Although it may not seem important on a high level, these issues can drastically change system performance. Moreover, carelessness with data types can cause unexpected bugs and issues. This is especially true when interfacing between multiple systems which is very common. Consider the Zynq chip by Xilinx. It features an ARM core along with custom programmable logic. This allows for attaching custom hardware to an ARM core for hardware acceleration of specialized functions. To properly do this, a solid understanding of data, types, and memory are mandatory.

Objectives

  • Become familiar with Code Composer Studio
  • Become familiar with basic concepts of C programming
  • Examine how data types affect how data is stored in memory

Part 0:

Fun with ints

Part 1:

Fun with floats

Part 2:

Fun with pointers

Lab Sheet:

Here is the in class lab sheet:

Presentation

Here is the in class presentation used to get you started: