RWL Posted October 8, 2016 Posted October 8, 2016 Ever wonder how the computer is able to preform arithmetic operations? I have a simple video explaining the basics of how mathematics is possible in a computer. Warning, this is meant to show basics.Link deleted
fiveworlds Posted October 8, 2016 Posted October 8, 2016 Easier explained as computers use databases to do mathematics. Each binary string corresponds to a memory location representing a number.
Endy0816 Posted October 8, 2016 Posted October 8, 2016 Well lookup tables are also used but Adders are how the computer does math without one.
Strange Posted October 8, 2016 Posted October 8, 2016 Each binary string corresponds to a memory location representing a number. Only if the binary string is an address.
swansont Posted October 8, 2016 Posted October 8, 2016 ! Moderator Note Rule 2.7Advertising and spam is prohibited. We don't mind if you put a link to your noncommercial site (e.g. a blog) in your signature and/or profile, but don't go around making threads to advertise it. Links, pictures and videos in posts should be relevant to the discussion, and members should be able to participate in the discussion without clicking any links or watching any videos. Videos and pictures should be accompanied by enough text to set the tone for the discussion, and should not be posted alone. Users advertising commercial sites will be banned.
fiveworlds Posted October 8, 2016 Posted October 8, 2016 Only if the binary string is an address. I mean the full adder is only a method of incrementing a binary string by a fixed amount what that binary corresponds to doesn't have to be numbers at all it could be letters or practically anything really.
EdEarl Posted October 8, 2016 Posted October 8, 2016 A long time ago, I played on an IBM 1620 computer, which had a number of odd features, one of which was it loaded the addition and multiplications tables from disk and did decimal arithmetic with a variable number of digits using these two tables. Computers typically operate on binary values using hardware to add, subtract, multiply and divide. Although, an iterative division algorithm such as Newton–Raphson division is commonly used; it can be built entirely with hardware, but is often microcode. AFAIK most people don't care about how computers do arithmetic, except hardware designers and a few geeks like me.
Sensei Posted October 9, 2016 Posted October 9, 2016 (edited) Only if the binary string is an address. I think he meant index to array float values[ 1024 ]; (...) float value = values[ index ]; CPU is doing it by adding address of 'values' variable together with 'index' variable (multiplied by fixed size of entry f.e. sizeof( float ), simple bit-shift). And then reading memory from this final address. Multiplication a * b will be possible to replace by looking at a_table[ b ] (for integers either a & b). So for a-b in range 0...255 (8 bits), there is needed array with unsigned short (16 bits), with size 256*256=65536 entries. (but it could be reduced to 32768 or slightly less, because a*b=b*a and 1*a=a and 0*a=0) A long time ago, I played on an IBM 1620 computer, which had a number of odd features, one of which was it loaded the addition and multiplications tables from disk and did decimal arithmetic with a variable number of digits using these two tables. My 2nd programmer had to do it just few years ago. Plentiful PIC/IC do have just basic operations. And everything else has to be emulated with code, or read from lookup table (stored on EPROM/EEPROM/flash). Edited October 9, 2016 by Sensei 1
EdEarl Posted October 9, 2016 Posted October 9, 2016 (edited) My 2nd programmer had to do it just few years ago. Plentiful PIC/IC do have just basic operations. And everything else has to be emulated with code, or read from lookup table (stored on EPROM/EEPROM/flash). The PIC microprocessors were 8-16 bit machines; the 1620 was a 4-bit machine made before integrated circuits with germanium transistors about the size of a pencil eraser. Each 6 bit memory word had a parity bit, a flag bit, and 4 bits that contained a decimal digit (0-9) or other stuff. A sequence of 5 digits was a memory address. The RISC PIC was complex compared to the 1620 CPU, but comparison is kind of like apples and oranges. Edited October 9, 2016 by EdEarl
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now