Wednesday, 24 January 2024

Von Neumann Architecture

 Von Neumann Architecture 

Von Neumann Architecture refers to a design model for computers where the processing unit, memory, and input-output devices are interconnected through a single, central system bus. This architecture was first proposed by John von Neumann, a Hungarian-American mathematician and physicist, in the mid-20th century.
Before the invention of Von Neumann Architecture, computers followed other designs, such as the Harvard Architecture, where memory and processing units were separated.


The core concept of this architecture is that it treats both instructions and data uniformly. This means that the same memory and processing resources are used to store and manipulate both program instructions and the data being processed. This design greatly simplifies the structure and operations of a computer, making it easier to understand and implement.

Key Components of Von Neumann Architecture

  • Central Processing Unit (CPU)
           The part of a computer that carries out instructions and performs arithmetic, logical, and control operations.
  • Memory 
            A place where the computer stores and retrieves data and instructions. Memory is divided into two types: primary memory, such as Random Access Memory (RAM), and secondary memory, like hard disk drives and solid-state drives.
  • Input-Output (I/O) devices
            Components responsible for interfacing the computer with the external world. Examples of I/O devices include keyboards, mice, printers, and monitors.
  • System Bus
            A communication pathway that connects the CPU, memory, and I/O devices, enabling data and control signals to flow between these components.

Features of Von Neumann Architecture

  • Unified memory structure 
            Both instructions and data are stored together in the same memory.
  • Sequential instruction processing 
            Program instructions are executed one after another in a linear sequence.
  • Shared system bus
            Components are interconnected through a central communication pathway, allowing for efficient communication and coordination.
  • Modularity
            The architecture is suitable for a wide range of computer systems, from simple microcontrollers to complex supercomputers, by scaling memory and processing capabilities.

Real-world examples of Von Neumann Architecture systems

  1. ENIAC (Electronic Numerical Integrator and Computer): ENIAC, considered one of the first general-purpose electronic computers, was developed in the 1940s to perform complex arithmetic and solve mathematical problems. Although it was not based on the Von Neumann Architecture initially, it was later modified to incorporate the principles of this architecture, laying the foundation for modern computer systems.
  2. EDVAC (Electronic Discrete Variable Automatic Computer): Built in the late 1940s, EDVAC was one of the earliest computers to fully implement the Von Neumann Architecture. Its design was significantly influenced by John von Neumann's paper "First Draft of a Report on the EDVAC," which first introduced the concepts of the stored-program computer and the Von Neumann Architecture.
  3. IBM 701: Introduced in 1952, the IBM 701 was IBM's first commercially available scientific computer. It was designed based on the Von Neumann Architecture, featuring a single memory storage for both instructions and data, as well as a single system bus for communication between components.
  4. Intel 4004: Developed in 1971, the Intel 4004 was the first commercially available microprocessor to implement the Von Neumann Architecture. It served as the foundation for the modern era of personal computing and established the architecture as the de facto standard for computer system design.
  5. Modern computer systems: Today, most personal computers, laptops, smartphones, and a wide range of embedded systems use the Von Neumann Architecture. For instance, devices based on Intel and AMD processors, as well as ARM-based devices such as those running on Apple's A-series chips, all follow the principles of the Von Neumann Architecture.

Saturday, 20 January 2024

Computer Program Design

Program Development Cycle 


    The program development cycle, known as the software development life cycle (SDLC) or programming development life cycle (PDLC), is a structured and systematic approach to creating software developers follow to design, develop, test and deploy software. This cycle ensure that the software is developed efficiently, meets the desired requirements and is of high quality.

    Overall, the programming development cycle serves as a guide for software development teams, enabling them to create robust and reliable software applications while maintaining high standards of quality and and meeting user requirements.

    It is a set of phases and steps that are followed by problem solver to define, develop and maintain a program. Following are the 6 phases of program development development life cycle.

  1. Review the Specification : The initial step involves a thorough examination of the project's specification and requirements. Stakeholders review and confirm a clear understanding of what the program is intended to accomplish.                                         
  2. Informal Design : Following the specification review, developers create a high-level, less detailed plan outlining the overall structure and functionally of the program. this informal design phase serves as a blueprint for the subsequent detailed design and coding.                                                                                                                               
  3. Formal Design : Developers create detailed technical specifications based on the informal design. This involves defining data structures in a more structured and comprehensive manner, providing a foundation for coding.                                               
  4. Code and Compile : This phase involves translating the formal design specification into actual code using a chosen programming language. The code is the compiled into machine readable instructions for the computer to execute.                                              
  5. Test  : Testing is a critical phase where the program is systematically evaluated to ensure it behaves as intended and meets specified requirements. Various testing methods, such as unit testing and system testing, are employed to identify and rectify any defects or issues.                                                                                                         
  6. Maintain : Maintenance is an ongoing process where developers address bugs, make updates and adapt the program to changing requirements. Regular maintenance ensures the program remains effective, reliable and up-to-date throughout its life cycle. 

    Checklist for preparing a Task List

  • What output  do you need to generate?
  • What input do you have?
  • What form will it be in?
  • Will the program have a list of tasks that needs to be done repeatedly(LOOP)?   
  • What are the other major tasks of the program?

    If it has repeated tasks :

  • What will be done within it?
  • What controls the loop?
  • What need to be done before the loop?
  • What needs to be done after the loop?

E.g. Let's prepare a cup of milk coffee. 
  • What output  do you need to generate?
        - A cup of milk coffee
  • What input do you have?
        - A cup, milk powder, sugar, coffee powder, water
  • What form will it be in?
        - A empty cup, dry milk powder, dry sugar, dry coffee powder, boiled water
  • Will the program have a list of tasks that needs to be done repeatedly(LOOP)?   
        - No
  • What are the other major tasks of the program?
        - Take a empty cup
        - Add milk powder into the cup
        - Add coffee powder into the cup
        - Add sugar into the cup
        - Add boiled water into the cup
        - Stir 1 minute





Principles of Program Design and Programming

 Generations of Programming Languages 

There are five generations in Programing Languages.

1st Generation

The first generation languages are low level languages that are machine language. The main benefit of programming in a first generation programming language is that the code a user writes can run very fast and efficiently, since it is directly executed by the CPU. However machine language is a lot more difficult to learn than higher generational programming languages, and it is far more difficult to edit if errors occur.







2nd Generation

The second generation languages are also low level languages that generally consist of assembly languages. This languages are sometimes used in kernels and device drivers, but more often find use in extremely intensive processing such as games, video editing, graphic manipulation.






3rd Generation

The third generation languages are high level languages such as C. Most popular general purpose languages today, such as C++, C#, Java, BASIC, FOTRAN and COBOL are also  third generation languages.






4th Generation

The fourth generation languages are consist of statements similar to statements in a human language. Fourth generation languages are commonly used in database programming and scripts. A fourth generation programming language is a programming language or programming environment designed with a specific purpose in mind, such as the development of commercial business software.








5th Generation

The fifth generation languages are programming languages that contain visual tools to help develop a program. A good example of a fifth generation language is Visual Basic. A fifth generation programming language is a programming language based around solving problems using constraints given to the program, rather than using an algorithm written by a programmer. Most constraint based and logic programming languages and some declarative languages are fifth generation languages.  




    

Friday, 19 January 2024

Computer Program Design

     What is Coding?

    Coding creates a set of instructions for computers to follow. These instructions determine what actions a computer can and cannot take. Coding allows programmers to build programs, such as websites and apps. Computer programmers can also tell computers how to process data in better, faster ways.
    Binary code is the primary language of all computers. Binary codes consists of only two numbers: one and zero (1 and 0). In the binary coding language, zero represents "off " and one represents "on".

A lot of people think coding and programming are the same thing. However, coding is only one part of programming.

Coding is the process of allowing humans to speak to computers. As computers only understand binary language, a series of zeroes and ones- humans need to use a programming language as a translator of sorts.

programming, on the other hand, includes not only coding but also the digital product's planning, testing, deployment and maintenance.

Benefits of learning coding

  • Elevate your career prospect:  Regardless of whether you work in the tech industry, learning ate least one programming language can help you stand out from the competition in an interview process or help you negotiate a highest salary.
  • Improve your problem solving skills: Many people who learn to code report an improved ability to break problems down into smaller pieces and approach problems with clearer, liner thinking.
  • Cultivate creativity: Coding gives you the ability to create  anything you can dream of.
  • Community: There are countless online communities for coders to exchange tips, tricks, chat and meet each other.



Principles of Program Design and Programming

    Let's make a little identification about the topic. 

  💁 What is a Computer?

               
 A computer is an electronic device that processes data to perform various tasks. It consists of  hardware, software components and input/output devices.

    Computer processing






The Central Processing Unit ( CPU ) is a fundamental component of a computer system and is often referred to as the "brain" of the computer. It performs most of the processing operations inside a computer, executing instructions and managing data manipulation. The CPU interprets and executes instructions from the computers memory, coordinating the activities of all the hardware components to perform various tasks.

Machine Language

Machine language is the language understood by a computer. It is very difficult to understand, but it is the only thing that the computer can work with. All programs and programming languages eventually generate or run programs in machine language. 

Computer Program

A computer program is a collection of instructions that can be executed by a computer to perform a specific task. A computer program is usually written by a computer programmer in a programming language. 

Von Neumann Architecture 


Von Neumann Architecture refers to a design model for computers where the processing unit, memory and input/output devices are interconnected through a single, central system bus. This architecture was first proposed by John Vo Neumann, a Hungarian-American mathematician and physicist, in the mid 20th century.







Types of Programming Languages



Tutorial 12

Functions  Question 01 Display all prime numbers between two Intervals using a function.   C Code                #include <stdio.h>   ...