Machine Language and Program Execution
A limited time offer! Get a custom sample essay written according to your requirements urgent 3h delivery guaranteedOrder Now
1. Computer Architecture.
“Computer architecture refers to those attributes of a system visible to a programmer or, put another way, those attributes that have a direct impact on the logical execution of program. Examples of architectural attributes include the instruction set, the number of bits used to represent various data types (e.g., numbers, characters), I/O mech, anisms, and techniques for addressing memory.”
Computer architecture describes that how a computer system is designed and what technologies it is compatible with. Computer architecture is a specification detailing how a set of software and hardware technology standards interact to form a computer system or platform. Example of computer architecture is von Neumann architecture, which is still used by most types of computers today. This was proposed by the mathematician John von Neumann in 1945. It describes the design of an electronic computer with its CPU, which includes;
The arithmetic logic unit (ALU)
Control unit (CU)
Memory for data and instructions
An input/output interface and external storage functions
Arithmetic logic unit(ALU).
An arithmetic-logic unit (ALU) is the part of a computer processor (CPU) that carries out arithmetic and logic operations on the operands in computer instruction words. In some processors, the ALU is divided into two units;
An arithmetic unit (AU)
A logic unit (LU).
Arithmetic unit: In a processor, the part that performs arithmetic operations is known as arithmetic unit. Some arithmetic operators are: (+, -, *, /, % ).
Logic unit: In a processor, the part that performs logical operation is known as logic unit. Some logical operators are:(, =, =, != ).
A control unit (CU) handles all processor control signals. It directs all input and output flow, fetches code for instructions from microprograms and directs other units and models by providing control and timing signals. A CU component is considered the processor brain because it issues orders to just about everything and ensures correct instruction execution.
“A processor register (CPU register) is one of a small set of data holding places that are part of the computer processor. A register may hold an instruction, a storage address, or any kind of data (such as a bit sequence or individual characters). Some instructions specify registers as part of the instruction. For example, an instruction may specify that the contents of two defined registers be added together and then placed in a specified register.”
o Registers are the “Bricks” of the CPU.
o Registers are used for high speed storage for operands.
o Registers are used for addressing memory
An operating system provides a platform to run and install softwares, application and many other programs. Common desktop operating systems include Windows, OS X, and Linux. While each OS is different, most provide a graphical user interface, or GUI, that includes a desktop and the ability to manage files and folders.
There are three categories of computer architecture:
• System Design: This includes all hardware components in the system, including data processors aside from the CPU, such as the graphics processing unit and direct memory access. It also includes memory controllers, data paths and miscellaneous things like multiprocessing and virtualization.
• Instruction Set Architecture (ISA): This is the embedded programming language of the central processing unit. It defines the CPU’s functions and capabilities based on what programming it can perform or process. This includes the word size, processor register types, memory addressing modes, data formats and the instruction set that programmers use.
• Microarchitecture: Otherwise known as computer organization, this type of architecture defines the data paths, data processing and storage elements, as well as how they should be implemented in the ISA.
2. Machine Language.
“Machine language is the basic low-level programming language designed to be recognized by a computer. The language is written in a binary code of 0s and 1s that represent electric impulses or off and on electrical states respectively. A group of such digits is called an instruction and it is translated into a command that the central processing unit or CPU understands.”
Sometimes machine language referred to as machine code or object code, machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding.
The exact machine language for a program or action can differ by operating system on the computer. The specific operating system will dictate how a compiler writes a program or action into machine language. Computer programs are written in one or more programming languages, like C++, Java, or Visual Basic. A computer cannot directly understand the programming languages used to create computer programs, so the program code must be compiled. Once a program’s code is compiled, the computer can understand it because the program’s code has been turned into machine language.
For example: Machine language (binary) for the text “Hello World”.
01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100
Example of binary machine language is the binary-coded decimal, where decimal numbers are encoded in binary form. Each decimal digit is coded as a four-digit binary number as follows:
• 0000 = 0
• 0001 = 1
• 0010 = 2
• 0011 = 3
• 0100 = 4
And so on ……..
For example, the decimal number 5,270 is represented by the binary code for 5, 2, 7, 0, which translates into 0101 0010 0111 0000.
The CPU has the ability to perform millions of instructions per second and this fact makes the binary machine language efficient, despite the volume of bits. It would be useful to note that different CPUs from different manufacturers use different machine languages.
3. Program Execution.
The process by which a computer machine performs the instructions of a computer program is known as program execution. Execution in computer and software engineering is the process by which a computer or a virtual machine performs the instructions of a computer program. The instructions in the program trigger sequences of simple actions on the executing machine. Those actions produce effects according to the semantics of the instructions in the program. Programs for a computer may execute in a batch process without human interaction, or a user may type commands in an interactive session of an interpreter. In this case the “commands” are simply programs, whose execution is chained together.
The instructions in the program perform simple actions on the executing machine. Those actions results according to the semantics of the instructions in the program. Little number of programs are executable on a bare machine. Operating system helps most of the programs to execute and run- time libraries specific to the source language that provide crucial services not supplied directly by the computer itself. Program execution can be divided in three categories.
Compiler: A compiler is a software program that transforms high-level source code that is written by a developer in a high-level programming language into a low-level object code (binary code) in machine language, which can be understood by the processor. The process of converting high-level programming into machine language is known as compilation. The processor executes object code, which indicates when binary high and low signals are required in the arithmetic logic unit of the processor.
Compilers that produce the object code meant to run on a system are called cross-compilers. Finally, a compiler that converts one programming language into another is called a language translator.
Interpreter: An interpreter is a computer program that is used to directly execute program instructions written using one of the many high-level programming languages. The interpreter transforms the high-level program into an intermediate language that it then executes, or it could parse the high-level source code and then performs the commands directly, which is done line by line or statement by statement. It means, the interpreter reads each statement of code and then converts or executes it directly. Since an interpreter reads and then executes code in a single process, it is very useful for scripting and other small programs. As such, it is commonly installed on Web servers, which run a lot of executable scripts.