First you must create a logic circuit using only basic gates such as AND, OR, NOR, NAND, NOT, etc. to implement an ADDER capable of adding two 4 bit binary numbers.
Second you must create a logic circuit using only basic gates such as AND, OR, NOR, NAND, NOT, etc. to implement a Subtractor that is capable of subtracting the second number from the first, by converting the second number into its 2's complement form and then adding the resulting number to the first number. You do not need to worry about accomodating the addition or subtraction of negative numbers as part of your assignment.
Finally, for the third part of the assignment you must create a limited ALU (Arithmetic logic unit) circuit using Logism that implements a Full Adder circuit capable of adding 2 – 4 bit binary numbers and subtracting 2- 4 bit binary numbers. You must also implement the ability to select a bitwise AND operation and a bitwise OR operation. For the ALU it is acceptable to use the Adder and Subtractor circuits that are listed under the "Arithmetic" folder in Logism. Please check the video lecture on Logism tips and tricks to learn how to use multi bit pins, and how to set up different gates to support more than 1 bit.
#include <stdio.h>
//function for Binary Addition
int AdditionofBinary(int a,int b)
{
int c; //carry
while (b != 0) {
//find carry and shift it left
c = (a & b) << 1;
//find the sum
a=a^b;
b=c;
}
return a;
}
//function for Binary Subtraction
int SubtrationofBinary(int a, int b)
{
int carry;
//get 2's compliment of b and add in a
b = AdditionofBinary(~b, 1);
while (b != 0) {
//find carry and shift it left
carry = (a & b) << 1;
//find the sum
a = a ^ b;
b = carry;
}
return a;
}
int main()
{
int number1,number2, binAdd, binSub;
printf("Input first integer value: ");
scanf("%d",&number1);
printf("Input second integer value: ");
scanf("%d",&number2);
binAdd=AdditionofBinary(number1,number2);
binSub=SubtrationofBinary(number1,number2);
printf("Binary Addition: %d\n",binAdd);
printf("Binary Subtraction: %d\n",binSub);
return 0;
}
First you must create a logic circuit using only basic gates such as AND, OR, NOR,...
Given 4-bit ripple carry adders and logic gates (AND, OR, NOT, XOR, XNOR, NAND, NOR). Construct a 12-bit adder/subtractor from the provided components. An input S will determine the type of operation. If S=0, it should add, otherwise subtract. DO THIS PLEASE. Show how you can simplify the circuit if you knew the circuit would always be adding 3. Start with the 4-bit ripple carry adder, set the value on input ‘B’ to the constant 3, and then reduce the...
Create a truth table to implement AND logic using only NAND gates. Draw the circuit diagram (schematic) for the implementation. Do the same for OR logic using only NOR gates.
For each of the following show the logic circuit with only NAND gates and also show the truth table. Create a NOT gate. Create an AND gate. Create an OR gate. Create a NOR gate. Create an XOR gate. Create a Half Adder
The Arithmetic Logic Unit The first topic for the project is to create an Arithmetic Logic Unit, using a structured approached with a Virtual Hardware Design Language such as Verilog. Mainly, the program is very close to a simulator for a programming calculator. An ALU typically has the following operations Math Functions: Add, Subtract, Multiply, Divide, Modulus Logic Functions: And, Or, XOR, Not, Nand, Nor, XNOR Error Modes: Divide by Zero, Overflow Support Functions: No Operation, Shift Left, Shift Right,...
1. What logic gates are known as universal gates? (1 point) a) nand, nor b) and, or, not c) nand, nor, xor, xnor d) None of the above 2. Write the half adder truth table. (4 points) 3. Fill in the blank. (1 point) A2 to 1 mux has input lines. 4. True or False? (1 point) A Boolean algebraic sum of products expression is the complement of the product of sums expression. 5. What is the minimum POS expression...
Using logisim to create a 4bit controlled comparator ECFICATIONS NPUTS Create a cireuit in Logisim thait will take the following inputs 4 bit binary number :4 bit binary number Control where C-O, A and B will be treated as unsigned binary C-1,A and B will be treated as 2's complement signed binary (for example, the number 301 represents the value 5' it is treated as unsigned binary but it represents the value - if it is treated as 2's complemene...
In this problem, you will design a 4-bit 2's complement sub tractor, implement it in Logic works, and test it. The 4-bit sub tractor works as follows: given two numbers X and Y in 2's complement binary representation on 4 bits, it outputs a 4-bit value representing X - Y in 2's complement. To obtain full marks, the following requirements must be met: You are only allowed to use basic gates, including NOT, AND, OR, NAND, NOR, XOR, XNOR. (You...
Using Structural Modeling in VHDL write the
code for:
An Arithmetic Logic Unit (ALU) shown in the
figure below. A (16-bit), B
(16-bit), Opcode (3-bit), and
Mode (1-bit) are the inputs; and
ALUOut (16-bit) and Cout (1-bit) are the outputs
of the design. A and B hold the values of the operands. Mode and
Opcode together indicate the type of the operation performed by
ALU.
The ALU components ARE:
-Arithmetic Unit that consists of one 16-bit
adder, 16-bit subtractor, 16-bit...
3. Realize AND logic and X-OR logic using NOR gates only. Clearly show the working for the logic realization and draw the resulting logic circuit diagram, which must only have NOR gates and nothing else.
2. Design a 1 bit full adder (inputs:A,B,CARRY_IN - outputs:SUM,CARRY_OUT) using: (a) basic CMOS gates: inverter, NOR and NAND gates (b) complex CMOS logic gates and inverters (c) compare the difference in transistor counts (d) assuming all transistors are the same size and kn'= kp', which version of the function do you expect to be faster? Why?