Hot answers tagged

40 votes

Why does Intel's Haswell chip allow floating point multiplication to be twice as fast as addition?

This possibly answers the title of the question, if not the body: Floating point addition requires aligning the two mantissa's before adding them (depending on the difference between the two ...
user avatar
  • 4,451
32 votes
Accepted

How do computers calculate sin values?

Typically high resolution sin(x) functions would be implemented with a CORDIC (COrdiate Rotation DIgital Computer) algorithm, which can be accomplished with a small number of iterations using only ...
user avatar
25 votes

Why does Intel's Haswell chip allow floating point multiplication to be twice as fast as addition?

In FP multiplication, exponent processing turns out to be simple addition (for exactly the same reason that multiplication in the log domain is merely addition). You have come across logarithms, I ...
user avatar
  • 65.8k
25 votes
Accepted

What is the process of going from machine code to electrically controlling individual transistors?

Ah, you're missing the STATE MACHINE concept. That's where we can "write code" made out of TTL hardware chips: data-selectors, 4-bit counters, gangs of parallel flipflops. (But all those are the ...
user avatar
  • 10.4k
23 votes

Why does Intel's Haswell chip allow floating point multiplication to be twice as fast as addition?

TL:DR: because Intel thought SSE/AVX FP add latency was more important than throughput, they chose not to run it on the FMA units in Haswell/Broadwell. Haswell runs (SIMD) FP multiply on the same ...
user avatar
  • 1,242
16 votes

does 8085 CPU have an extra register within ALU?

As @duskwuff suspected, I've looked into this. To answer the question, the 8085 has two extra registers in the ALU. The 8085 has several "hidden" registers: a 16-bit WZ pair and two 8-bit ALU helper ...
user avatar
  • 2,342
14 votes

How do computers calculate sin values?

Most computer trig libraries are based on polynomial approximations, which gives the best balance between speed an accuracy. For example, a dozen or so multiplication and add/subtract operations is ...
user avatar
  • 164k
13 votes
Accepted

What does the logic statement "F = AB" mean? Bitwise A AND B?

Yes, when written as multiplication in normal math, it means AND in Boolean logic. This does make some sense when you think about it. Make a truth table of multiplying two value that can be either 0 ...
user avatar
10 votes

Why does Intel's Haswell chip allow floating point multiplication to be twice as fast as addition?

I'm going to look at this part: "Why is it that they would allow"... TL;DR - because they designed it that way. It is a management decision. Sure there are answers of mantissa and bit shifters, but ...
user avatar
  • 231
10 votes
Accepted

For a mathematical operation in CPU, could power consumption depend on the operands?

In general, power consumption in a modern CMOS CPU is dependent on the number of signals changing state (that is, dynamic power) plus leakage (static power). Dynamic power thus varies based on the ...
user avatar
  • 40.3k
9 votes

What is the process of going from machine code to electrically controlling individual transistors?

A processor is really a finite state machine (FSM) for implementing the machine code instructions. It reads the instructions from memory and uses the required hardware, such as the ALU, to implement ...
user avatar
  • 5,934
8 votes
Accepted

How do you do operations on large numbers using a small fixed-width ALU?

You can manipulate arbitrarily wide numbers using a finite width ALU. However, multiple operations are required when the number is wider than the ALU. To illustrate this, I'll use a PIC 18 as ...
user avatar
8 votes

Why are 11, 111, 1111, ... equivalent to -1 in two's complement?

In an unsigned binary representation, only positive numbers can be represented, and the weight of each bit including the most significant bit is a power of two. So with a word size of 8 (byte), <...
user avatar
  • 46.9k
8 votes

How do I implement a rotate left 1 bit operation in a 16-bit ALU in logisim

The simplest thing is to just add the input number to itself. Doubling a number (multiplication by 2) is equivalent to a left shift in binary. In other words, select ADD as the ALU operation, and feed ...
user avatar
  • 164k
7 votes
Accepted

Microprocessor architecture bits vs bus sizes

As with many texts written for beginners the situation has been somewhat simplified. The assumption is that a 32-bit processor does all address operations and calculations also in 32 bits. From that ...
user avatar
  • 14.1k
7 votes

Why does Intel's Haswell chip allow floating point multiplication to be twice as fast as addition?

This diagram from Intel may help: It appears they've given each unit a FMA (fused multiply-add) as well as a multiply and a single adder. They may or may not share hardware underneath. The question ...
user avatar
  • 45k
7 votes
Accepted

How are irrational numbers best represented and processed by computers?

There’s nothing special about computers in this context. An infinite number of nonrepeating decimal places cannot be stored or manipulated on a computer, on paper, or in a human brain. Irrational ...
user avatar
  • 20.5k
6 votes

Why are 11, 111, 1111, ... equivalent to -1 in two's complement?

In 2's complement the MSb is defined as -(2n) where n is the bit position of the MSb. Due to how numbers work, all bits other than the MSb add up to (2n)-1. Adding those together results in -1.
user avatar
6 votes

How can z80 uses a 4-bit ALU and return results in a single clock cycle?

The instruction actually ends at the end of T2 of the M1 cycle that reads the next instruction, as explained at z80.info So, an instruction such as: SUB r can be broken down like this: ...
user avatar
6 votes
Accepted

What is formal verification of hardware?

Formal verification is state-point mapping done to ensure a schematic matches verilog or RTL model of the module. This means that for every set of inputs and states defined in the RTL model, the ...
user avatar
  • 4,225
6 votes
Accepted

Why does a full adder need an OR gate?

You're making a couple of assumptions: Multiple outputs can be connected directly together When any such output is "high", then the wire is "high". This is known as "wired-OR", and indeed, such ...
user avatar
  • 164k
6 votes

How does a processor negate an integer?

Option 1 is how I've seen it and how I've designed it for integer inversion. The "add 1" takes one cycle and the bit inversion is absorbed in the same cycle. For subtraction, the same adder ...
user avatar
  • 2,925
6 votes

For a mathematical operation in CPU, could power consumption depend on the operands?

Yes power consumption can (and often does) depend on the operands at least to some extent. Older ARMv4 CPUs made this explicit for some operations like multiplication, where if you added more zeros to ...
user avatar
  • 10.4k
5 votes
Accepted

Why does my ALU design delay outputting the results for two clock cycles since input of valid data?

If you want immediate results from your ALU, then don't use a clocked process at all: ...
user avatar
  • 164k
5 votes
Accepted

How does Decimal Mode in an ALU work?

I don't know what logic the 6502 uses exactly, but many micros have a decimal adjust instruction that depends on having carry and nibble carry flags available. It is applied after a binary 8-bit ...
user avatar
5 votes
Accepted

How do bitshifts work on the electrical layer?

In computers, arithmetic operations are performed by a specific integrated circuit that is placed inside the microprocessor, and is called "Arithmetic Logic Unit". You can have a look at the Wikipedia ...
user avatar
  • 681
5 votes

Replace ALU With Lookup Table?

The bottom line is that a lookup table is made up of logic gates, and it always takes fewer gates to implement the kinds of ALU operations you're talking about directly rather than use a lookup table. ...
user avatar
  • 164k
5 votes

does 8085 CPU have an extra register within ALU?

In synchronous designs it is an important task of designer to ensure such things do not happen. Register, which is having data being "clocked" into, is having specific dynamic properties like clock ...
user avatar
  • 6,580
5 votes

does 8085 CPU have an extra register within ALU?

The accumulator is the ALU's output register. The 8085 has a two phase clock. Where single clock instruction like a NOP took 2 clock cycles. Similar to the 8088 used in the original IBM PC, the ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible