• Welcome to the Off-Topic/Schweb's Lounge

    In addition to the Mac-Forums Community Guidelines, there are a few things you should pay attention to while in The Lounge.

    Lounge Rules
    • If your post belongs in a different forum, please post it there.
    • While this area is for off-topic conversations, that doesn't mean that every conversation will be permitted. The moderators will, at their sole discretion, close or delete any threads which do not serve a beneficial purpose to the community.

    Understand that while The Lounge is here as a place to relax and discuss random topics, that doesn't mean we will allow any topic. Topics which are inflammatory, hurtful, or otherwise clash with our Mac-Forums Community Guidelines will be removed.

What's this thing I'm using?

Joined
Sep 13, 2010
Messages
11
Reaction score
0
Points
1
I know this is dumb...but how does a computer execute logical operations? I have some vague understanding of binaries & the flow of electricity and such but what controls these and how are these turned into operations?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
What is a Computer - Wikipedia, the free encyclopedia?

Start with that page to get the basics..

A computer at it's core is made up on a CPU (Central Processing Unit). These CPUs come in a few varieties, a lot more in the past, but the dominent ones now are X86 (Intel/AMD), ARM(a whole bunch of manufacturers) and PowerPC (IBM).

These CPUs have an instruction set that is unique to them and they are the most BASIC possible thing. "move a value from here to there", "add one value to another", "subtract one value from another", "compare this value with that value" and so on..

Assembly language - Wikipedia, the free encyclopedia is used to write these instructions..this is also called "machine language" since it's the lowest possible level of code that can be executed on the processors.

Apart from VERY small machines and very early boot code, not much else is written in Assembly. Most things are written in higher level languages like C, C++, Objective-C and so on..

Now this is the "software" side of things..

On the "hardware" side of things, apart from the CPU you have a bunch of other helpers hardware that manage unique functionality, things like the south/north bridge, memory bus handlers, and so on..

They all interface back to the CPU and provide access to devices on these unique buses.

This is no where a complete picture of how a computer works, but hopefully it gets you started in the right direction..
 
OP
N
Joined
Sep 13, 2010
Messages
11
Reaction score
0
Points
1
Thanks for your reply. I had read the entry about computers on Wikipedia and I think I understand most of what you write, what I can't grasp is how these basic operations you describe are actually executed. If you tell the CPU to add one to one, what actually happens? How can a computer perform such an operation?
 
Joined
Apr 6, 2011
Messages
1,291
Reaction score
43
Points
48
Location
Louisville, KY - USA
Your Mac's Specs
MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM
That's the thing - there really isn't any way to condense a whole course on computer engineering into a post any better than what Razor has already done.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Without a basic understanding garnered by an engineering degree..I don't believe theres anyway for us to try to explain how a computer does what it does in a forum environment.

The things I spoke about are as low as software can go, but now when you say how does a CPU actually add 2 values..within the CPU there are various circuits, AND, NAND, NOR, XOR and various gates that are grouped to create a rudimentary level of logic that can perform the necessary actions at a VERY fast pace to get you the Ghz number you see..

If you are truly interested in all of these nitty gritty details and are of college age, perhaps that might be something you might want to pursue academically..

I'm sure doing no justice to the things I learned during my 4 years of my BS degree..:)
 
OP
N
Joined
Sep 13, 2010
Messages
11
Reaction score
0
Points
1
I'm slightly beyond college-age, which doesn't seem to translate to maturity of the questions I ask :-( I am but a casual user of computers who is amazed at their capability to execute logical operations. Relegating this capability to an ominous entity called the CPU, unfortunately, doesn't clarify much. But I appreciate my lack of knowledge prohibits me from delving much further..
 
OP
N
Joined
Sep 13, 2010
Messages
11
Reaction score
0
Points
1
(Is a degree really the only option to get a slightly firmer grip? My, what a puzzling box this must be!)
 
Joined
Apr 6, 2011
Messages
1,291
Reaction score
43
Points
48
Location
Louisville, KY - USA
Your Mac's Specs
MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM
If you are not getting what Razor is putting down, a class will be what is needed. That is the simplest short description I have seen that makes sense.

If computers were so easy to learn at the machine level, well, they would not be as expensive as they are and the Engineers who create the updates and squash more and more circuits together in smaller and smaller spaces would not be making all that much since there would be so many.
 
OP
N
Joined
Sep 13, 2010
Messages
11
Reaction score
0
Points
1
Hold on, Deckyon, maybe I'm expressing myself poorly. In no way was I ever aiming at being an engineer. I am not trying to build a computer and certainly have no intention of squashing more and more together in smaller and smaller spaces. I am "merely" interested in what makes a CPU tick. I was hoping there'd be some midway between a college degree and the generalities of Wikipedia.
 
Joined
Apr 6, 2011
Messages
1,291
Reaction score
43
Points
48
Location
Louisville, KY - USA
Your Mac's Specs
MBP 17" 2011, 2.3GHz Intel Quad-Core i7, 8GB RAM, MacMini 2011, 2.7GHz Intel Dual-Core i7, 8GB RAM
I don't think you are getting it. There is no easy way to explain how computers, CPUs work outside a dedicated class if you want more detail than what has been given to you already.
 

BrianLachoreVPI


Retired Staff
Joined
Feb 24, 2011
Messages
3,733
Reaction score
124
Points
63
Location
Maryland
Your Mac's Specs
March 2011 15" MBP 2.3GHz i7 Quad Core 8GB Ram | Mid 2011 27" iMac 3.4 GHz i7 16 GB RAM 2 TB HDD
Yay for Truth Tables and Karnaugh Maps :)

Seriously, as has been said, it's probably a little tricky to adequately explain. Funny how a question can sound simple - "how does a CPU add a 1" - but to truly explain - requires a certain level of fundamental knowledge to explain the answer.

If you look at this site - it's a nice generic description of a microprocessor. Gives you a good feel for some of the logical and functional blocks. Of course this is very generic. Microprocessor Example

If you go here Arithmetic logic unit - Wikipedia, the free encyclopedia you'll see a very general ALU description along with other fundamentals concepts that need to be understood to really gain the level of understanding you're asking for.

If you're really interested - find a microprocessor class. I'd bet your local CC has one that's high level - that takes you through the basics of base numbering systems, some elementary math, shows how that ties to assembly language, register transfer language and connects to higher level languages.

There's actually quite a journey to truly understand how 2 numbers get added by a computer. Here's a decent description Physics Forums - View Single Post - How does a processor work This link has a couple of animations Untitled Document I'm sure there are more out there. Good luck. :)
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
These guys do a great job of explaining computer science - without a computer
Computer Science Unplugged |
YouTube - ‪Computer Science Unplugged - The Show‬‏

But to sum it up - everything - at the lowest level is a switch. The switch is either on or off - hence binary. Then you use transistors to make logic gates as mentioned above to make logical decisions. You build those up into bigger and bigger units - but to understand the logic of what is going on - watch the video and peruse the site.

There is also this article on the Socratic method to teach binary.
The Socratic Method
 
OP
N
Joined
Sep 13, 2010
Messages
11
Reaction score
0
Points
1
Thanks everyone for your input. I think I ought to learn a thing or two from all of this..
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top