Digital logic is the representation of signals and sequencing of a digital circuit. It is the basis for digital computing. (Note: There is the Electrical Engineering Stack Exchange website which is more suited to asking questions on hardware.)
Questions tagged [digital-logic]
229 questions
1
vote
0 answers
Programming 16 bit adder in javascript from gates
I am following the course nand2tetris and doing the exercises but not with there software. Instead I'm trying todo everything in javascript. The purpose is to build a nand gate and from that you create all your chips/gates.
I wrote for every gate…

John
- 728
- 2
- 15
- 37
1
vote
1 answer
High-impedance in RTL
What is the purpose of the code in the "else" line:
if RdEnabB = '1' then
DoutB <= regfile(to_integer(unsigned(RdAddrB)));
else
DoutB <= (others => 'Z');
end if;
in the accepted answer of this…

evilpascal
- 117
- 3
- 12
1
vote
1 answer
What is the USART digital logic in AVR microcontrollers?
Just reading about USART connection in AVR microcontrollers and i faced this question:
What is the digital logic used in USART(RXC, TXC and other internals) of the AVR microcontrollers?
I've found the answer to this question in the datasheet of…

hexpheus
- 741
- 10
- 22
1
vote
4 answers
Why does the number of bits in the binary representation of decimal number 16 == 5?
This question not probably not typical stackoverflow but am not sure where to ask this small question of mine.
Problem:
Find the number of bits in the binary representation of decimal number 16?
Now I tried to solve this one using the formula $2^n…

Quixotic
- 2,424
- 7
- 36
- 58
1
vote
1 answer
Confusion in VHDL code
I am trying to implement a recoding logic for a 32 bit multiplier in VHDL. Besides, the input bit vector (x_in) to be recoded, it has one extra input "one". The intent is when "one" is '1' the output should be x_in else if "one" is '0', it should be…

sarthak
- 774
- 1
- 11
- 27
1
vote
3 answers
Arithmetic mean of a register in vhdl
For a project I am currently working on, I am trying to take some inputs, store them in a register then find the arithmetic mean of the register. All of my inputs are 24-bits long. My registers are 4-inputs long therefore I simply remove the last…

mqwert97
- 13
- 3
1
vote
1 answer
Find minterms using a boolean expression using Python
I am using sympy library. I can compute SOP using min-terms
>>> from sympy.logic import POSform
>>> from sympy import symbols
>>> w, x, y, z = symbols('w x y z')
>>> minterms = [[0, 0, 0, 1], [0, 0, 1, 1], [0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 1,…

Pratik
- 204
- 2
- 14
1
vote
2 answers
Entity Instantiation Inside of a Process
I am trying to make a two dimensional array of full adders with specific logic with their inputs and outputs. I currently have two for-generate statements of rows and columns, and then an if-elsif-else statement to decide how to connect that full…

woo2
- 33
- 1
- 7
1
vote
2 answers
What type of variable shift operator needs in SystemVerilog?
I have an 8-bit signed variable A and a 3-bit value n. I want to shift operator n times in an always statement but it doesn't work and output is x.
reg signed [7:0] A = //something;
reg [2:0] n = 3'b//something
always @(A, n) begin
w = 8'b0;
w = A…

Ju Bc
- 173
- 2
- 11
1
vote
1 answer
SystemVerilog Error: variable written by continuous and procedural assignments
I want to create a test bench for my ALU circuit. When i compile it, i get some errors:
module ALU_TB();
logic [7:0] A, B, w;
logic [2:0] s, n;
logic co, ci, si;
wire ov, neg, zero, gt, eq;
ALU alu8(A, B, s, si, ci, n, co, ov, zero, neg, gt, eq,…

T.Meyer
- 55
- 2
- 6
1
vote
1 answer
2-dimenstional array in expects 1 dimension
I am trying to make an array of std_logic_vectors in VHDL. The array is used in a generate statement to make a barrel shifter. Each element of the array (array, vector) should be an individually addressable bit. Here's some of my code.
Signal…

woo2
- 33
- 1
- 7
1
vote
1 answer
De Morgan's law optimization doesn't work
I have boolean expression, which was simplified using Karnaugh's map (The first line). And then I used de Morgan's Law to make the expression suitable for using only NAND gates (The second line). But when I create a logic gate circuit it does not…

aretas_pau
- 99
- 1
- 8
1
vote
3 answers
What is the component for if-clause in digital logic?
Do you have any ideas which component use for if clause in digital logic
What is the component for if-clause in digital logic?

Kooss
- 71
- 1
- 1
- 8
1
vote
1 answer
Oscillating signal on a digital output of AVR ATmega32U4
I set up my Atmel ATMega32U4 with a relay (using an NPN transistor to control the 5V supply to the relay, not driving it directly with the microcontroller). I want to use PD4 as a digital output to control the relay's state. As I'll be using USB…

Sean
- 1,346
- 13
- 24
1
vote
1 answer
Digital Logic - Implementing Boolean expression using minimum number of 2-input NOR gates
Implement this Boolean expression using a minimum number of 2-input NOR gates. Then, illustrate with a clearly labelled logic circuit diagram.
F(w,x,y) = (x+y)(w+y)(x'+y')
= [(x+y)' + (w+y)' + (x'+y')']' //double negation
= [y'(x'+…

Vanley Web
- 11
- 2