[SOLVED] COMP8049 Lab 1

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab-1-Solution-tzrvi0.zip (41.5 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

Q1

Write a c program which  reads in a text file and finds all the identifiers in the file. An identifier is a token (sequence of characters)  that starts with an underscore or a letter and continues with underscores or letters or digits.

You are to sort all the identifiers in the input text file and output them in alphabetical order.

Q2

Create a model for the traffic light simulation and state machine that is detailed in section 10.4 of the traffic-light-simulator.pdf  also here

http://users.ece.utexas.edu/~valvano/Volume1/E-Book/ C10_FiniteStateMachines.htm

This model is a c program that runs on your laptop in Linux. You can use the code in traffic-model.c. You can then emulate a button press by simple key presses on the keyboard. For example:-

  1. enter the letter N to indicate that the North button is on.
  2. enter the letter E to indicate that the East button is on.
  3. enter the letter B to indicate that both buttons are on.
  4. any other key to indicate that both buttons are off

Q3

Using your code in Q2 build a traffic light controller model and simulation that is cross compiled for an ARM based SOC.

You can use the qemu-system-arm emulator https://wiki.qemu.org/Documentation/Platforms/ARM.

  • | P a g e

See here for steps to build a binary for the qemu emulated versatilepb board.

https://balau82.wordpress.com/2010/02/28/hello-world-for-bare-metal-arm-usingqemu/

See emulating-arm-pl011-serial-ports.pdf for an example which emulates the serial communications to the qemu emulated versatilepb board. https://balau82.wordpress.com/2010/11/30/emulating-arm-pl011-serial-ports/

  • Lab-1-Solution-tzrvi0.zip