Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4566196
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:45:17+00:00 2026-05-21T18:45:17+00:00

I read a wiki that says for multiplication the CPU adds! From wiki: Pass

  • 0

I read a wiki that says for multiplication the CPU adds!

From wiki:

Pass the only weight-1 wire through, output: 1 weight-1 wire
Pass the two weight-2 wires through, outputs: 2 weight-2 wires
Add a full adder for weight 4, outputs: 1 weight-4 wire, 1 weight-8 wire
Add a full adder for weight 8, and pass the remaining wire through, outputs: 2 weight-8 wires,     1 weight-16 wire
Add a full adder for weight 16, outputs: 1 weight-16 wire, 1 weight-32 wire
Pass the two weight-32 wires through, outputs: 2 weight-32 wires
Pass the only weight-64 wire through, output: 1 weight-64 wire

I not understand whole, but I think it keeps adding then if it not know how to add it pass and goes next addition. here full article: http://en.wikipedia.org/wiki/Dadda_tree

I do lot research and I think it is slow. So instead of the CPU doing multiplication I want to do it myself.

I wrote this function:

function do_multiply($a, $b)
{
    while($b > 0) { 
        $a = $a + $a;
        $b = $b-1;
}

All I want to do is if I asked function to multiply 2 and 3, I want to add 2 to 2, three times, correct?

So I want to do this:

2+2+2

This is same as 2*3, correct?

When I run this it gives me 16. Why do I get the wrong answer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:45:18+00:00Added an answer on May 21, 2026 at 6:45 pm
    function do_multiply($a, $b)
    

    {

    $res = 0;
    while($b > 0) { 
        $res += $a;
        $b = $b-1;
    }
    return $res;
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SharePoint Wiki that I'm permitting anonymous users read-only access to. However
Does anyone know of an existing ruby implementation of a read/write lock - http://en.wikipedia.org/wiki/Readers-writer_lock
I read somewhere once that the modulus operator is inefficient on small embedded devices
I read in this article that a company has created a software capable of
UPDATE: It was suggested in the comments that I create a wiki for this.
I have a question about the C++ visibility attribute. I have read http://gcc.gnu.org/wiki/Visibility and
I have a project that adds elements to an AutoCad drawing. I noticed that
I read this PHP RegEx page , but either I'm missing something, misreading something,
Having read the threads Is SqlCommand.Dispose enough? and Closing and Disposing a WCF Service
I read the Git manual, FAQ, Git - SVN crash course, etc. and they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.