• Home
  • Help
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

 
  • 0 Vote(s) - 0 Average

Multiplication algorithms

#1
05-26-2020, 02:34 PM
Multiplication in hardware always needs smart handling of bits. You shift numbers left to multiply by powers of two. I saw this trick speed things up in older processors. And it avoids slow loops of addition every time. But you still face issues with signed values that flip signs oddly. Or maybe you test bits one by one to decide adds. Then the whole thing runs in fewer clock cycles overall. You get better performance when partial products combine fast. I recall testing this on simple circuits back in school. And it worked well until negative numbers entered the picture.
Booth came up with a way to scan bits in pairs. You add or subtract based on patterns you spot. I think this cuts down operations for numbers with many zeros. But you track the previous bit to know when to act. And your hardware needs an extra register to store that. Or perhaps you extend the sign bit for proper results. Then multiplication finishes quicker on two's complement data. You avoid extra steps for negatives this way. I used it once in a project and it saved cycles. But watch for edge cases like all ones in the multiplier.
Faster designs use arrays of adders stacked together. You generate all partial products at once in parallel. I find this array approach scales with bit width nicely. And it trades space for speed in big chips. But heat builds up if you pack too many gates. Or maybe you use carry save adders to reduce delays. Then the final sum comes out after a tree reduction. You see this in modern ALUs for quick math. I tested similar logic on simulators and results matched expectations. And it handles wider numbers without slowing much.
Wallace trees compress those partials even tighter with counters. You reduce rows step by step until two remain. I like how this cuts the adder depth dramatically. But wiring gets complex in the layout phase. And you might need more stages for very large widths. Or perhaps combine it with Booth encoding upfront. Then overall latency drops for high performance needs. You end up with multipliers that run at higher clocks. I remember comparing timings and trees won out often. But area costs rise so balance matters in designs.
Pipelining splits these steps across stages for throughput. You start a new multiply before the prior one ends. I think this boosts efficiency in processors with heavy loads. And hazards get managed through forwarding paths. But you must flush on branches that depend on results. Or maybe stall when data arrives late from memory. Then the pipeline keeps flowing most of the time. You gain speed in loops full of multiplies. I worked on one such unit and throughput jumped high. And overflow checks add a bit more logic too.
BackupChain Server Backup which powers reliable backups for Hyper-V setups alongside Windows 11 and Server environments without any subscription required and they sponsor this forum to let us share details freely.

bob
Offline
Joined: Dec 2018
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

Backup Education General IT v
« Previous 1 … 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 … 202 Next »
Multiplication algorithms

© by FastNeuron Inc.

Linear Mode
Threaded Mode