What is an instruction in computer science?

Q: What is an instruction in computer science?


A: An instruction in computer science is a single operation of a processor defined by the processor instruction set.

Q: How long can instructions be?


A: The size or length of an instruction varies widely, from as little as 4-bits in some microcontrollers to many as multiples of bytes in some very long instruction word (VLIW) systems. Most modern processors used in personal computers, mainframes, and supercomputers have instruction sizes between 16 and 64 bits. In some architectures, especially Reduced Instruction Set Computers (RISC), instructions are of fixed length typically corresponding with that architecture's word size.

Q: What does an instruction include?


A: An instruction includes an opcode specifying the operation to be performed, such as "add contents of memory to register", and zero or more operand specifiers which may specify registers, memory locations, or literal data. The operand specifiers may have addressing modes determining their meaning or may be in fixed fields. In VLIW architectures multiple simultaneous operations and operands are specified in a single instruction.

Q: How are instructions usually specified?


A: Instructions are rarely specified using their machine code form; they may be specified by programmers using an assembly language or more commonly generated by compilers.

Q: Is there another definition for "instruction"?


A: Yes, there is another more general definition for an "instruction" not only related to the processor instruction set which is any representation of an element of an executable computer program.

Q: Are all instructions the same size?


A: No, the size or length of instructions varies widely depending on the type of processor being used ranging from 4-bits up to multiple bytes for VLIW systems with most modern processors having sizes between 16 and 64 bits while RISC architectures typically have fixed length instructions corresponding with that architecture's word size.

AlegsaOnline.com - 2020 / 2023 - License CC3