CMPS 002 - Computer Literacy

Prof. Paulo Franca

CyberSlug Rules!

Classes

Class Syllabus

Grading Policy

Labs

Interact

Login

  • enter system
  • get attendance
  • submit work
  • take lab quiz
  • check scores

Help

Help me!

Links

Staff only

 

 

 

Datacare   Ahshay

 

Executing a Program:

How does a program execute? Refer to the Slug Computer.

  • Program is in memory (machine language)

  • Computer executes one instruction at a time

  • Computer uses the IC (Instruction Counter) to remember which instruction to fetch.

  • Part of the instruction represents the code (what to do)

  • Another part represents the address (where data is)

Sample programs to try:

  • Start with a value in position 90. Write a program to copy the contents of position 90 (A) to position 91 (B)
  • Start with three values in positions 90,91,92. Write a program that adds these three values and writes the result in position 94.
  • Start with three values in positions 90,91,92. Write a program that computes the average of these three values and writes the result in position 94.
  • Start with two values in positions 90 (A) and 91 (B). Write a program that copies whatever value is higher to position 92 (C).