What is the difference between Instruction Set and Instruction Set Architecture (ISA)?
Asked Answered
M

3

7

I am not able to understand the difference between Instruction set and Instruction set architecture.

I know what is an instruction set. Instruction set just defines the possible instructions we can give to the processor and how the instruction are give ( therefore the instruction format ) to the processor.

Now what is Instruction set architecture ?

I have looked up wikipedia, it has a page on instruction set and inside it, on the first line there is a link to instruction set architecture which redirects to computer architecture.

So is the instruction set architecture same as computer architecture ?

Please can someone explain the concrete difference between IS and ISA so that I can understand what is an ISA and what does the ISA add to the instruction set.

Masto answered 8/4, 2017 at 12:12 Comment(0)
A
5

Not really computer architecture as a computer involves the peripherals and PCB and perhaps the chassis, buttons, connectors, etc.

The instruction set architecture is the architecture, the look and feel of the thing. Just like the architecture of a building. The instruction set is the set of instructions that implement that architecture. (as Brendan has pointed out you can have more than one set that implements the same architecture). A good example is ARM, ARMv7-m defines the architecture for some/most of the cortex-m (the marketing name for a product family) cores. The cortex-m3, cortex-m4, cortex-m7 conform to the ARMv7-m architecture which is defined in the ARM Architectural Reference Manual for the ARMv7-m. But these are different cores, they may be complete rewrites from scratch, they may have different depth pipelines, one might have a cache and/or fpu where another doesnt. In this case there is an instruction set defined by the architecture that they all conform to (the fpu is an exception in this case and not defined in the architecture).

An architect may design the building or building guidelines for a McDonalds and when you drive by you look at that building and without looking at the logo you know it is a mcdonalds or a wendys or a pizza hut. But not everyone of those buildings was built by the same construction crew using lumber from the same mill or paint from the same vendor, etc. The instruction set architecture defines the architecture and probably the instruction set the machine code it implements but the specific chips or cores made to conform to that architecture might not be identically built, on the surface the architecture looks the same, it looks like a Taco Bell, but it may be built differently than a Taco Bell in the next town over, you can still buy tacos that taste pretty much the same when you use that facility. As far as the machine code/instruction set goes programming two different cores from the same architecture look and feel the same, the tacos taste the same. But the implementation may be different (they might put the tomatoes in before the sour cream instead of after).

Good, bad, or otherwise, the two terms are often used interchangeably to mean the same thing (the instruction set, the possibly machine code instructions for the thing being talked about).

Antoniettaantonin answered 8/4, 2017 at 12:51 Comment(3)
Ok so I now understand that an ISA just tells that what all is feasible ("The instruction set architecture is the architecture, the look and feel of the thing.") . And the instruction set is what all instructions a cpu supports. So,is it correct to say that two different cpus having the same ISA can have different completely different instruction sets?Masto
I would say no on that, that is a different architecture. Understand to some extent these terms and how they are used are subject to opinion. Perhaps sublte differences across chips like 99% the same but one has a few instructions the other doesnt kind of thing, but completely different I would call a different architecture.Antoniettaantonin
Ok i now get that if i tell you about the instruction set architecture of my computer then you definitely know the capabilities of my processor along with its instruction set. I guess this is right ?Masto
T
3

"Instruction Set" is the set of instructions that a specific CPU actually supports.

"Instruction Set Architecture" is the set of instructions that a CPU (that implements that ISA) might or might not support.

For example, the "80x86 ISA" includes various extensions (64-bit, SSE, AVX, etc); but for an old 80486 (which implements the "80x86 ISA") the instruction set does not support 64-bit, SSE, AVX, etc.

Tibia answered 8/4, 2017 at 12:31 Comment(0)
P
1

The two terms are interchangeable.

This passage uses both instruction set architecture and instruction in the same sentence.

https://en.wikipedia.org/wiki/Instruction_set_architecture

An instruction set architecture is distinguished from a microarchitecture, which is the set of processor design techniques used, in a particular processor, to implement the instruction set. Processors with different microarchitectures can share a common instruction set. For example, the Intel Pentium and the Advanced Micro Devices Athlon implement nearly identical versions of the x86 instruction set, but have radically different internal designs.

Another example is in this paper explaining RISC-V: https://digitalassets.lib.berkeley.edu/techreports/ucb/text/EECS-2016-1.pdf

Much of the paper uses Instruction Set Architecture or ISA, but then Chapter 2 is titled "Why Develop a New Instruction Set?". Followed by this passage:

Of equal importance is the massive complexity of the popular commercial instruction sets. They are quite difficult to fully implement in hardware, and yet there is little incentive to create simpler subset ISAs

Again you see instruction set and instruction set architecture (ISA) used interchangeably.

The instruction set architecture / instruction set is best thought of as the "interface". Machine code that conforms to that interface will run on any CPU which implements that interface (regardless of that CPU's microarchitecture/implementation details).

This includes more than just a set of instructions. The bytes that make up the instructions must be positioned correctly along with operands and other parameters. The number and size of the registers is important, along with other details such as memory alignment and endianness that the machine code must conform to in order to run correctly on a CPU. The above RISC-V paper is a great reference for further reading on the subject.

Pagepageant answered 1/7, 2021 at 5:54 Comment(3)
An ISA also includes semantics beyond the instructions, like guarantees for atomicity and memory ordering, how interrupts are delivered, hardware page-table formats, control-register contents. All of these things are (or can be) independent of the actual instructions and their machine encodings. Instruction encodings normally imply number of registers, but not their width, but yes that's an important architecture parameter. (Normally but not always: ISAs with a sliding window of registers like SPARC or IA-64 have more registers than 2^bits in machine code reg fields...)Canal
In contexts where the distinction matters, "instruction set" would normally not be used to talk about some of those other things. e.g. "The x86 instruction set includes an atomic compare-exchange" would work with ISA instead, but the reverse wouldn't read well in "the x86 ISA has a strongly-ordered memory model, basically program-order plus a store buffer with store-forwarding". Memory order is a part of the architecture separate from the instruction-set. (e.g. Intel's vol.2 manual documents the instruction set, vol.1 is overall architecture, vol.3 is systems programming).Canal
So yes there are some contexts where the distinction doesn't matter, like the quotes you found. To be fair, the RISC-V usage of "new instruction set" does kind of imply new architecture to go with it, but you could argue either way that they were using it as a true synonym of ISA or that they were just implying that a new instruction set would be part of a new architecture.Canal

© 2022 - 2024 — McMap. All rights reserved.