CPSC 231: Assignment 1 (Due Monday, September 30)

Weighting = 3%, 20 marks total

Grade out of 20 Letter
20 A+
19 A
18 A-
17 B+
16 B
15 B-
14 C+
13 C
12 C-
11 D+
10 D
9 D-
Less than 9 F
 

Introduction to Unix Part 1: Common commands (3 marks)

On the Unix workstations in the Computer Science lab complete the following steps:

·                Login onto your Unix account

·                Start a script session

·                Show the contents of your home directory

·                Show your location (path) in the Unix file system

·                Make a new directory called “231”

·                Show the contents of your home directory

·                 Enter the newly created ‘231’ directory

·                 Show the contents of the newly created ‘231’ directory

·                Show your location (path) in the Unix file system

·                Go to the official directory for CPSC 231 (/home/231)

·                Show the contents of the CPSC 231 directory

·                Show your location (path) in the Unix file system

·                Show the contents of the CPSC 231 directory with information on permissions, file creation dates (i.e., listing directory information in the "long" format).                                 

·                Go to the directory for assignment 1 (/home/231/assignments/assignment1)                                           

·                Show the contents of the assignment 1 directory

·                Show your location (path) in the Unix file system

·                Show the contents of the a1 file (display it onscreen)                             

·                Copy the a1 file to the newly created ‘231’ directory that you created (in your home directory).

·                Go to the newly created ‘231’ directory (in your home directory)

·                Show the contents of the newly created ‘231’ directory.

·                End the script session

·                Print out the script and hand it in (along with the rest of your assignment 1 submission) – make sure you read the submission guidelines!

Learning objectives:

·    Getting comfortable with the basic commands that you will use on an everyday basis in the Computer Science Unix environment.

Grading:

·    3 marks maximum for all steps properly completed

·    2 marks if a step was missed or improperly completed

·    1 marks if two or more steps were missed or improperly completed

·    Zero marks if more than two steps were missed or improperly completed

 

Introduction to Unix Part 2: Using a text editor (1 mark)

 Using the Unix text editor of your choice (e.g., Emacs, XEmacs etc.) type a brief document (approximately a page or 2 – 3 paragraphs) that describes what the area of Computer Science is all about.  Note: The information that you base your report on can come from a number of sources:  

Just make sure that if you choose an outside source of information that you reference the source and you put it in your own words (and don’t merely cut and paste everything!)

Print out this document and hand it in (along with the rest of your Assignment 1 submission) – make sure you read the submission guidelines!

Learning objectives

Grading

You will either receive 1 mark for an assignment that fulfills all of the above requirements or 0 for one that does not.

 

Number systems and logic 

Number conversion: Perform the necessary number conversions in order to fill in the missing values in the table below (4 marks).

Number system

Value in decimal

Value in binary

Value in Octal

Value in Hexadecimal

17

10001

21

 

26

11010

 

1A

22.5

 

26.4

16.8

 

11111111

377

FF

 

Non-decimal based math: Perform the following unsigned binary additions and subtractions using four bits (2 marks).

 

1

0

1

 

1

1

0

1

+

0

1

1

 

-

1

1

Complements: Perform the necessary conversions between the three binary representations in order to fill in the missing values in the table below (3 marks).

Number system

Unsigned binary value

One’s complement value

Two’ complement value

-01011

10100

 

-01111

 

10001

 

01010

01010

   

Non-decimal based math: Perform the following subtractions via the negate and add technique using 4 bits.   Show the final result both in unsigned binary and in the appropriate signed representation (2 marks).                                                                                 

One's complement      Two's complement

 

0

1

1

0

 

 

0

1

0

1

-

0

0

1

1

 

 

0

1

0

0

1's

 

2's

 

U/S

 

U/S

Logic: Perform the following logical operations (5 marks)

(AND)

 

T

T

F

T

F

T

AND 

F

T

T

F

F

T

 

 

(OR)

 

1

1 0 1 0 1

OR 

0 1 1 0 0 1

 

 

(XOR)

 

T

T

F

T

F

T

XOR 

F

T

T

F

F

T

 

 

(NAND)

 

T

T

F

T

F

T

NAND 

F

T

T

F

F

T

 

 

(NOR)

 

T

T

F

T

F

T

NOR 

F

T

T

F

F

T

 

Learning objectives