COMPUTER ARCHITECTURE
Spring Semester 2001
COMPUTER ARCHITECTURE - Spring 2001 Programming Assignments
(NOTE: Additional guidelines for each program will be provided in class.)
- Prog #1: MACHINE WORDS AND MEMORY ORGANIZATION
Write a program in ANSI C (not C++) that does the following:
- Create an array of characters 16 char's long. Use char[]
- Input a string using less than 16 chars with scanf()
- Pass this array to a function that will print out
- each character
- it's decimal value
- it's hexadecimal value
- it's binary equivalent
- it's memory address
For each array position (all 16) put the above five values on the same line, separated by spaces.
- Now pass this array to a function that will receive it as an int array (no pointers needed). Print out:
- each integer in decimal
- it's hexadecimal value
- it's binary equivalent
- it's memory address
For each array position (just 8) put the above four values on the same line, separated by spaces.
- Now pass this array to a function that will receive it a float array (no pointers). Print out:
- each float
- it's hexadecimal value
- it's binary equivalent
- it's memory address
For each array position (just 4) put the above four values on the same line, separated by spaces.
- Explain and analyze the results, including using the binary representation of
short int to show how to get the decimal equivalent.
- Challenge - Try running the same program on some other platform such as a Macintosh or Silicon Graphics and see if the results differ.
- PROG #2: TBA