T103/TM103: Computer Organization and Architecture

Question 1: Working with MARIE (10 Marks)

Write a MARIE assembly program that performs the following tasks:

Reads TWO decimal numbers A and B from the keyboard.

If A = B, Result= 0.

If A<B, store -1 in Result

If A>B, Result= A-B

Display the Result.

You should include the MARIE code in your answer (not a screenshot!), with an explanation of your code, especially the critical instructions.

Provide 3 screenshots of the MARIE simulator after running the program, showing the code and result for each of the above three cases.

Instructions:

Use the ORG instruction to start your program at address equivalent to 33610.

Change the representation of the Input and Output windows in the simulator to Decimal.

Make sure to include proper labels and directives at the end of your program.

Question 2: Working with Logic Gates (10 Marks)

You are asked to watch the video, Boolean Simplification using Karnaugh Map (Credit: ENGRTUTOR) which is found on the CLMS week 5 section of the course, and answer the following question:

In a 4-variable Karnaugh map, some cells may be marked d (or X) to represent dont-care conditions. A dont-care means the output is unspecified for that input combination. When simplifying a function using a K-map, a dont-care cell may be treated as 1 only when it helps create a larger valid group (thus simplifying the expression). Otherwise, it is treated as 0 and ignored. There is no requirement to include all dont-cares in groups.

Rule: Use a dont-care in a group only if it results in a simpler expression.

Given the 4-variable K-map for F(A,B,C,D) below, answer the following:

F C’D’ C’D CD CD’

A’B’ 1 1 d 1

A’B 0 d d 0

AB d 1 d 0

AB’ d 1 1 d

a) Grouping decision (4 marks)

Identify and clearly show the groups you will use in the given K-map to obtain a minimal simplified expression.

You may treat selected dont-care (d) cells as 1 only if doing so allows the formation of a larger valid group and leads to further simplification.

Any dont-care cell that is not required for simplification must be treated as 0 and left ungrouped.

Clearly distinguish the dont-care cells that you chose to use (for example, by marking them in a different color or notation on the K-map).

Briefly justify your grouping choices, explaining how the selected dont-care cells contribute to achieving the minimal expression.

b) Minimal simplified expression (2 marks)

Write the simplified expression of F.

c) Complement using De Morgan (2 marks)

Find F by applying De Morgans Law to your simplified result from part (b).

Show steps clearly.

Your final answer must be in POS (Product of Sums) form (you may keep it without simplification beyond De Morgan).

d) NAND-only implementation (2 marks)

Draw the minimal logic diagram of F using NAND gates only.

You may use NAND as NOT (inverter) where needed.

Your final diagram must implement the same function as in part (b).

WRITE MY PAPER

Comments

Leave a Reply