What is an instruction set?

Thread Starter

mike _Jacobs

Joined Jun 9, 2021
223
all that and im still confused on what the "instruction set" is
when you hear the term instruciton set of a power pc, or an arm or x86
What is it referring to. What layer of abstraction. That is the part no one has been able to answer yet.
I know that at the end of the line, the instruction set is going to eventually be converted to electrical signals that turn transistors on and off to enable data and command flow at an electron level. However, i dont think when people use the term instruction set about an arm for example that is what they are referring to.

So what is an instruction set when discussed in the context of an "ARM instruction set" or "X86 instruction set"
 

Papabravo

Joined Feb 24, 2006
22,083
After reading the posts in this thread, I'm not sure there is any answer that will be meaningful to you until and unless you become more familiar with the internal operations of a processor -- any processor. My advice to you is to let this question go for the time being and dig into the fundamental operations of ANY processor. That experience will allow you to generalize that specific information and apply it to all processors.
 

Thread Starter

mike _Jacobs

Joined Jun 9, 2021
223
After reading the posts in this thread, I'm not sure there is any answer that will be meaningful to you until and unless you become more familiar with the internal operations of a processor -- any processor. My advice to you is to let this question go for the time being and dig into the fundamental operations of ANY processor. That experience will allow you to generalize that specific information and apply it to all processors.
Im literally talking about transistors turning off and on to allow bits to move on data buses and and command flow bits.
How much lower do you want me to know about how a CPU works.
That's about as low as it gets. Believe me, i know how a CPU works. The problem here is semantics. To many people improperly use the term ISA and its often confused with the micro architecture. You tubers and people on the forums often while trying to write things short hand cause more confusion.

This forum IN particular Papa bravo and a few others, given thier experience i do trust so it was worth asking to me.
I think the question was fairly straightforward. But the conversation was derailed with a sidebar discussion for the last 10 posts.
 

Papabravo

Joined Feb 24, 2006
22,083
I want you to know how the machine works at the level of a single instruction. Then build on that. Pick any one instruction you want from any particular set. I don't care about the actual transistors, but you do need to know how data moves around in an abstract way - not through actual connections. I have no idea why this is so difficult for you and I really have no answers that I have any confidence will get through to you. You're stuck -- I'm sorry I don't have an answer for you. Asking the same question repeatedly, expecting a different answer does not seem to be working for you.
 

nsaspook

Joined Aug 27, 2009
16,340
Im literally talking about transistors turning off and on to allow bits to move on data buses and and command flow bits.
How much lower do you want me to know about how a CPU works.
That's about as low as it gets. Believe me, i know how a CPU works. The problem here is semantics. To many people improperly use the term ISA and its often confused with the micro architecture. You tubers and people on the forums often while trying to write things short hand cause more confusion.

This forum IN particular Papa bravo and a few others, given thier experience i do trust so it was worth asking to me.
I think the question was fairly straightforward. But the conversation was derailed with a sidebar discussion for the last 10 posts.
Yes, the instruction set being executed at program memory level is not always the 'instruction set microarchitecture' that moves electrons at the internal chip die level. Most of us designed a simple processor in school from TTL or some other basic logic family so we do know the difference.

1678220612690.png

The SAP-1 was a popular learning device.
https://karenok.github.io/SAP-1-Computer/
 
Last edited:

MrChips

Joined Oct 2, 2009
34,872
Here is the Instruction Set of Atmel AVR.

1678226517964.png

I have worked with more than a dozen different microprocessors and they all basically follow some kind of structure similar to this.
 

MrAl

Joined Jun 17, 2014
13,720
So i have tried to understand this but every video i watch tells me something different.

I understand that a program or process has program instructions.
For example a program that adds two numbers together.
Instruction #1 - Get first number
instruction #2 - Get second number
instruction #3 - add one and two together

And so many youtube videos say this is the instruction set. I dont think that is true.

When i think of an instruction set, i think of the set of binary codes, that corelates to some hardware configuration in a CPU.
For example, an instruction X sets certain transistors on or off inside of a CPU to allow a hardware configuration to move push data onto a data bus or something similar in a CPU. That to me is what the CPU instruction set is.

These guys on youtube keep calling program instructions the "instruction set" and i dont think that is correct

Am i totally off base?
Hi,

An instruction set is a general idea in that you can have an instruction set for a lot of different kinds of devices and situations. It's basically just a list of commands. The commands are manifest in written language and usually have an accompanying binary form. The written language allows us to understand what the commands do while the binary form allows the machine to understand what it is supposed to do.

For example, for a microcontroller you would find a listing of the commands and what they affect such as registers, peripherals, i/o pins, EEPROM, etc.
For a remote control automobile you might have some simple list like, "turn right", "turn left", "back up", "go fast", "go slow".

You are probably more interested in the microcontroller instructions though. This is a list of commands that tell the device what to do and when to do it. The commands you decide to use will be stored in some sort of memory such as flash memory in the form of a binary code. The program instruction counter loads these commands into the instruction decoder and the instruction decoder turns on or off various transistors to get the particular instruction to do what it was intended to do. It could be as simple as setting an i/o port pin to a '1' or to a '0', or setting a peripheral DAC output to 2.1 volts.
The binary code for different instructions will be different for each instruction. For example, binary 10000001 could be for "move register A to the accumulator". Binary 10000002 could be for "add register B to the accumulator". The binary codes are stored in memory and are read by the instruction decoder and that decoder is a hardware device that is designed to decode each instruction in a different way and cause the other parts of the hardware to perform different operations.
The basic parts are:
The clock which clocks the program counter.
Program memory that holds the instructions.
The program counter which addresses memory in a particular order which can be changed with certain instructions.
The instruction decoder which decodes the binary instructions and performs operations that result in the completion of the instruction.
The accumulator that performs math operations.
The i/o pins that interact electrically with the outside world.

These are the basics of what we see in microcontrollers and microprocessors. In modern hardware it can get a lot more involved such as with the use of pipelines and instruction prediction algorithms and power management.

I can tell you that once you start to work with any of these you very quickly get a handle on what an instruction set is.
If you are interested in the pure philosophy behind this though you may never (ha ha).
 
Last edited:
Top