Boolean Algebra & Logisim Task- Computer Systems- Report Writing Assignment

Internal Code: TV185
Report Writing Assignment:
Task:
The following truth table describes a Boolean function with four input values X1, X2, X3, X4 and two output values Z1, Z2.
Boolean
The main result of this task will be a logical circuit correctly implementing this Boolean function in the logisim simulator. Each step as defined in the following sub-tasks needs to be documented and explained.
1.1 Step 1: Boolean Algebra Expressions (13 points)
Write the Boolean function as Boolean algebra terms. First, think about how to deal with the two outputs. Then, describe each single row in terms of Boolean algebra. Finally, combine the terms for single rows into larger terms. Briefly explain these steps for your particular truth table.
1.2 Step 2: Logical circuit in Logisim (13 points)
Model the resulting Boolean terms from Step 1 in a single Logisim circuit, using the basic gates AND, OR, NOT. You can use gates with more than two inputs. Explain what you did for each step. Test your circuit using values from the truth table and document the tests.
1.3 Step 3: Optimized circuit (13 points)
The goal of this task is to find a minimal circuit using only AND, OR, and NOT gates. Based on the truth table and Boolean algebra terms from Step 1, optimize the function using Karnaugh maps. You will need to create two Karnaugh maps, one for each output. Your documentation should show the maps as well as the groups found in the maps and how they relate to terms in the optimized Boolean function. Then use Logisim to create a minimal circuit. Dont use any other gates than AND, OR, and NOT. Test your optimized circuit using values from the truth table.
2 A MARIE calculator
In this task you will develop a MARIE calculator application. We will break it down into small steps for you. Most of the tasks require you to write code, test cases and some small analysis. The code must contain comments, and you submit it as .mas and .mex files together with the rest of your assignment. The test cases should also be working, self-contained MARIE assembly files. The analysis needs to be submitted as part of the main PDF file you submit for this assignment.
Note that all tasks below only need to work for positive numbers. If you want a challenge, you can try and make your calculator work for negative numbers, but it’s not required to get full marks. In-class interviews: You will be required to demonstrate your code to your tutor after the submission deadline. Failure to demonstrate will lead to zero marks being awarded to the entire programming part of this assignment.
2.1 MARIE integer multiplication and division
2.1.1 Multiplication (8 points)
Implement a subroutine for multiplication, call it Multiply (based on the multiplication code you wrote in the labs – you can use the sample solution as a guideline). Test your subroutine by writing a test program that calls the subroutine with different arguments, and then step through the program in the MARIE simulator. You need to submit a MARIE file (.mas and .mex) that contains the subroutine and a test case, (call it ”2.1.1 Multiply”)
2.1.2 Power (8 points)
The power operation is defined as repeated multiplication of the same factor. For example, 9 power 2 is 9 × 9 = 81, and 3 power 5 is 3 × 3 × 3 × 3 × 3 = 243. More generally, we have X power Y, where X is called the base, and Y is called the exponent. Exponent corresponds to the number of times the base is used as a factor. The basic idea of computing the power is to repeatedly call the Multiply subroutine, which was implemented in the previous task. Your task is to implement a subroutine for power (call it Power).
Test your subroutine by writing a test program that calls the subroutine with different arguments, and then step through the programs in the MARIE simulator. You need to submit a MARIE file (.mas and .mex) that contains the subroutine and a test case, (call it ”2.1.2 Power”) 2.2 Reverse Polish Notation (RPN)
RPN is a notation for arithmetic expressions in which the operator follows the arguments. For example, instead of writing 5 + 7, we would write 5 7 +. For more complex expressions, this has the advantage that no parentheses are needed: compare 5 × (7 + 3) to the RPN notation 5 7 3 + ×.
A calculator for RPN can be implemented using a stack, one of the fundamental data structures we use in programming. A stack is just a pile of data: you can only push a new data value to the top of the stack, or pop the top-most value. To evaluate RPN, we just need to go through the RPN expression from left to right. When we find a number, we push it onto the stack. When we find an operator, we pop the top-most two numbers from the stack, compute the result of the operation, and push the result back onto the stack. Here is a step-by-step evaluation of 5 7 3 + ×:
Boolean1
Note that we read the stack from left to right here, so e.g. after reading the 7, the stack contains the values 5 and 7, with 7 at the top of the stack. After all operations are finished, the final result is the only value left on the stack.
2.2.1 A stack in MARIE assembly (15 points)
A stack can be implemented in memory by keeping track of the address of the current top of the stack. This address is called the StackPointer, and we use a label to access it easily:
StackPointer, HEX 0FF
In this example, we set the initial stack pointer to address 0FF.
A push operation increments the stack pointer (StackPointer = StackPointer + 1) and then writes the new value into the address pointed to by StackPointer. A pop operation returns the value at the address pointed to by the StackPointer, and it decrements the StackPointer (StackPointer = StackPointer – 1). This means that when we push a
value, the stack “grows upwards” from a low address towards FFF.
1. Write a sequence of instructions that pushes your full name in a reverse order onto the stack and then pops it again, printing each character using the Output instruction (your full name should be printed in the right order). Step through your code to make sure that the StackPointer is incremented and decremented correctly, and that the values end up in the right memory locations. The name should be hardcoded (without input instruction).
2. Write a program that implements Push and Pop subroutines. Test the subroutines by pushing and popping a few values using the input instruction, stepping through the code to make sure the stack works as expected. The program should accept any number of characters to be pushed, it will be poped only when you hit the backslash key.
Note: We should switch MARIE’s input field to ASCII and No Linefeeds mode, meaning that we can directly type in ASCII code.
You need to submit two source files for this task! (call them ”2.2.1 Stack.mas and .mex”, ”2.2.1 PushPop.mas and .mex” respectively)
2.2.2 A simple RPN calculator (15 points)
We will now implement a simple RPN calculator that can only perform a single operation: addition.
We will use the Input instruction to let the user input a sequence of numbers and operators. To simplify the implementation, we will switch MARIE’s input field to Dec mode, meaning that we can directly type in decimal numbers. But how can we input operators?
We will simply only allow positive numbers as input values, and use negative numbers as operators. For this first version, we will use ?1 to mean addition.
So to compute 10 + (20 + 30) we would have to enter 10 20 30 ? 1 ? 1. Of course we could also enter 10 20 ? 1 30 ? 1 (which would correspond to (10 + 20) + 30).

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services