CHARISTOPHER ALEXANDER Says that each pattern describes a problem which occurs over and over again in our environment and that describes the core of the solution to that problem in such a way that you can use these solutions a million times without ever doing it.A design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.
Uses of design pattern:
- Design patterns are the best solution for the recording problem in the application programming environment.
- It is responsible for design pattern analysis in another arms including GUI (graphical user interface)
- It is mainly used in object oriented programming
Design pattern elements:
In general a pattern has four essential elements they are
PATTERN NAME: The pattern name is a handle we can use to describe a design problem, its solutions, and consequences in a word or two. Naming a pattern immediately increases our design vocabulary. It lets us design at a higher level of abstraction. Having a vocabulary for patterns lets us talk about them with our colleagues, in our documentation, and even to ourselves. It makes it easier to think about designs and to communicate them and their trade-offs to others. Finding good names has been one of the hardest parts of developing our catalog.
PROBLEMS: The problem describes when to apply the pattern. It explains the problem and its context. It might describe specific design problems such as how to represent algorithms as objects. It might describe class or object structures that are symptomatic of an inflexible design. Sometimes the problem will include a list of conditions that must be met before it makes sense to apply the pattern.
SOLUTIONS:The solution describes the elements that make of the design there relationships responsibilities and collaborations.
CONSEQUENCES: The consequences are the result and trade of applying the pattern The consequence of a pattern includes its impact on a system i.e;Every problem will be having some consequences
8051 has the following features they are:
1.4096 bytes of on-chip program memory
2.128 bytes on-chip data memory
3.Four register banks
4.128 user defined software software flags
5.32 bidirectional I/O lines organised as four 8-bit ports
6.Two multiple modes ,16-bit timers/counters
7.Two level prioritized interrupt structure
8.Binary or decimal arthematic
8086 has powerful set of registers .It includes general purpose registers,segment registers,pointers and index registers and flag registers
GENERAL PURPOSE REGISTERS:8086 has four 16-bit general purpose registers.They are labeled as AX,BX,CX,DX.Each 16-bit register can be split into 28bit registers.For example BX can be split into BH and BL.The general purpose registers are either used for holding data,variables and intermediate results temporarily.
- AX-used as accumulator
- BX-used as offset storage for generating physical address
- CX-used as a default counter in case of string and loop instruction.
SEGMENT REGISTER: the physical address of 8086 is 20-bit wdide to access 1 mbyte memory locations .8086 uses memory segmentation.It treats the 1mbyte of memory as divided into segments with a max size of 64kbyte.There are 4 active segments.They are code segment,data segment,stack segment and extra segment.
- cs register holds the upper 16-bit of starting address of the segment from which the BIU is currently fetching code byte
- ss register holds for the upper 16-bit of the starting address for the program stack
- es and ds registers are used to hold the upper 16-bits of starting address of the two memory segments which are used for data
POINTERS AND INDEXED REGISTERS: To get 20-bit physical address one or more pointer or indexed registers are associated with each segment registers.The pointer rgister IP,BP,and SP are associated with code,data and stack segments .The index registers DI and SI are used as a general purpose registers as well as for offset storage in case of indexed,base indexed and relative based indexed addressing modes.
FLAG REGISTER: flag register contains the following active flags
carry flag(CF),parity flag(PF),auxiliary flag(AF),zero flag(ZF),sign flag(SF),overflow flag(OF),trap flag(TF),interrupt flag(IF),direction flag(DF).
Degrees of Parallelism: Degrees of parallelism is a measuring unit that defines the capability of a distributed system to run multiple programs or operations concurrently (or) in parallel. With the improvements in computing technology, DOP evolved from bit-level parallelism to Job level parallelism. Bit-level Parallelism (BLP): This type of parallelism was typically used in systems that were monolithic, expensive and were based on bits. In these types of systems bit-level parallelism is used to transform bit-level processing into word level processing.
Instruction Level Parallelism (ILP): When processing evolved from 4-bit to 64-bits, ILP gets employed with which more than one instructions can be processed concurrently. Some examples of ILP include multithreading, pipelining, super scalar computing etc.
Data-level Parallelism (DLP): DLP depends on hardware and compiler support in order to carry out its work efficiently.It was employed in SIMD processors.
Task-Level Parallelism (TLP): It came into existence with the development of CMPs (Chip Multiprocessors) and multicore processors. It is not preferred over other types of DOP, because it is complex in coding and compiling.
Job Level Parallelism (JLP): With the development of distributed computing, granularity of processing increased in terms of processing. Therefore, DOPS is transformed in terms of Job-Level Parallelism (TLP).
Trend Towards Utility Computing: In today's world, the global IT industry has experienced a huge emergence in the model of computing called "Cloud Computing". It is a new acceptance as a new market category. Practically, cloud computing has evolved through various phases among which grid and utility computing holds much of the significance. Utility computing is a quantifiable (metered) service which acts as a means for computational and storage resources. The functions and operations performed by this service are the same as traditional public utility companies. But, utility service is the improvised version of the traditional service as the former service is free from all impediments that incurred in the latter one. It was basically utilized by early enterprise adopters for non-mission critical need. So, later on utility computing too was extended to an advanced level called cloud computing. This form of computing enabled the virtualisation technology and virtual servers easily accessible to the IT department. The buzz and excitement around cloud computing is considered as the emergence of a new model of computing in the IT industry. This has helped in increasing the storage flexibility, high-speed bandwidth and universal software interoperability as well as in decreasing the cost.
There are four different types of testing that can be performed on a software system. They are as follows.
1. Unit testing
2. Component testing
3. Integration testing
4. System testing.
1. Unit Testing:- A unit is the smallest piece of source code that can be tested. It is also known as a module which consists of several lines of code that are processed by a single programmer. The main purpose of performing unit testing is to reveal that a particular unit doesn't fulfill the specified functional requirements and also to show that the structural implementation is not similar to the expected structure designed.
Unit tests can be both static tests and dynamic tests. At first. static tests are performed followed by the dynamic tests to check the test paths, boundaries and branches. Most of the unit tests are dynamic white box structural tests. These tests require either the execution of the software as a whole or parts of software. If a bug is revealed while performing the unit test, it is referred to as a unit bug.
2. Component testing:- Component testing is nothing but black box functional testing. This testing is used to test a single component or a group of components. A component is created by integrating one or more modules to form a single Target component. A module is a component and the function it calls is also a component. Thus, a component can either be an individual module or whole integrated system. Component testing is performed when a component doesn't match with its functional specification or its implementation structure, defined during preliminary test design. If such problems occur while performing the tests, they are referred to as component bugs. These bugs are eliminated by using necessary debugging tools.
3. Integration Testing:- Integration is a process of combining smaller components to produce larger components. Integration testing is performed when the individual components undergo component testing successfully. But when components are integrated, component testing is either incorrect or inconsistent. It also ensures that each individual component behave as per the specifications that are defined during test design. The main purpose of integration testing is to be detect the inconsistencies between these components. For example, A and B are components that have gone through component testing successfully, but failed when integrated.
Some of the situations where inconsistency arises are as follows,
(i) When there is an improper call or return statement.
(ii) When there is an inconsistent standard for data validation.
(iii) When an inconsistent method is used for handling the data objects.
Integrated objects testing is a higher level component testing compared to integration testing. The objective of integration testing is to wipe out the difficulties that occur while integrating individual components.
Following are the steps to perform integration testing,
(i) A and B components undergo component testing.
(ii) A and B are integrated to perform integration testing.
(iii) The new integrated component [A, B] finally undergoes component testing.
4. System Testing:- System testing exposes bugs that are not resulted from the components or from the inconsistencies between the components. System testing is a black box functional testing to test the entire software system. It is performed to show the behavior of the system. System testing is done either on the whole system that is integrated or only on the important parts of a system. During the test design, it ensures the systems's behavior as per the requirements specification. Testing is performed for the following applications like accountability, security, performance, sensitivity, configuration, start-up and recovery.
Internet development trends include.
(i) Internet of things (IOT)
(ii) Cyber-physical systems (CPS)
(i) Internet of Things (IOT): Internet refers to the interconnection of various devices that forms a network whereas Internet Of things is a network that connects various objects devices, tools etc., that are used in computing. These things are connected usually via sensors wirelessly because there exist certain variations in terms of their size, time and space. Most common type of sensor used to provide this kind of connectivity includes RFID and GPS technology.
It is now possible to allocate 2128 IP addresses with the advent of IPv6 that might include computers along with other devices such as mobile phones. A suggestion dictated by researchers associated with IOT is that an IOT must be capable of handing trillion objects concurrently irrespective of their types. This is because in future, each person will depend on an average of 100 to 5000 objects. Due to this, things needed to be classified universally which makes it complex. This complexity can be decreased by employing threshold value. The major aim of IOT is to provide communication between various things and humans irrespective of their location and time at a low cost.
(ii) Cyber Physical Systems (CPS): The systems that provide collaboration of computational elements with the physical objects that exist in the real world is known as Cyber Physical Systems (CPS). It is typically considered as a network that provides communication between physical objects and computational things. The application areas of CPS include civil infrastructure chemical research, transport, energy, entertainment and many more.
The concept of CPS is similar to IOT except that it involves VR (Virtual Reality) applications to be available for use with physical entities. A real time example of CPS is a robot whose movement is carried out with the help of various sensors along with navigation and wireless networking features.
- It stands for high performance cloud computing which improves the performance by computing by increasing the speed.
- The main motivation behind such computing is improvement in various fields such as engineering and scientific etc.., which made the speed measure over p-flops and g-flops.
- Modern computing involve desktops or pc connected over LANs and WANs where computing must provide efficient ways to make servers transparent along with faster access.
- It stands for high throughput computing which focuses on providing concurrent access to the data present over the internet over millions of devices.
- It can be defined as the rate at which the task is carried out.
- Rate can be increased with respect to the number of tasks while decreasing the time. Apart from speeding up the processing it also has the feature to capture the issues associated with cost, security and reliability .
Unlike multi processor systems that make use of multiple processors to carry out concurrent operations, multicore CPUs make use of multiple cores within a single processor. The idea here is to divide the processor into multiple cores such as dual, quad etc to carry out operations in parallel. The main advantage of these systems is that it improves potential performance of the overall system. One of the major examples of such systems in Intel processors whose speed of processing increased from 10 MHZ to 4 GHZ. This value is considered as limit for most (or) all of the chips that are based on CMOS because of the power constraints. These constraints can be removed by employing ILP mechanisms which are based on super scalar architecture and speculative execution.
Some systems use many-core GPU (Graphics Processing Units) that make use of thousands of processor cores. These GPUs are capable of managing instructions with varying magnitudes similar to that of multi core CPU.
Some of the processors that are based on multi-core and multithreaded processing are Intel i7. AMD opteron, IBM power 6 and many more. Multithreading: Multithreading is a feature which enables multiple threads to execute on a single processor in an overlapping manner. A thread is an atomic unit of a process and many threads usually make up a process. In a multithreading
environment, the resources of a processor are being shared by multiple threads, so each thread gets a separate copy of the functional unit or resource. Functional units generally include
a register file, a separate Program Counter (pc) or a separate page table to enable virtual memory access, which in turn enables multiple program to execute simultaneously by sharing the memory
To enable multithreading, the hardware must be able to perform threads switching which is more efficient than switching the processes, as each process consists of threads and usually takes many clock cycles for its execution. As threads are lightweight they can execute and switch among themselves during the execution. Therefore they are considered more efficient and fast than processes.
Multithreading can be implemented in two ways
1. Fine-grained multithreading
2. Coarse-grained multithreading.
1. Fine Grained Multithreading: In this approach, the threads are switched on each instruction. The delay caused because of the switch operation of threads is very little. The threads are switched only if the current running thread encounters a stall. The subsequent thread is chosen from a pool of waiting threads in a round-robin fashion. The approach becomes effective if threads are switched at every clock cycle.
Advantage: The advantage of fine-grained multithreading is that it can efficiently recover the losses of throughput which come from short and long stalls of the thread.
Disadvantage: The execution of the stalled thread is delayed that in turn decreases the execution speed of that individual thread since another thread is being executed in its place.
2. Coarse-Grained Multithreading: Coarse-grained multithreading is another approach for implementing multithreading. In a coarse grained multithreading approach, the threads switch only when a costly stall is encountered. A costly stall can be defined as a stall where a thread requires resources which usually consumes more CPU clock cycles than required.
A level 2 cache miss is an example of a costly stall. If such a case is encountered in a coarse-grained approach, then another thread replaces it and executes till the stalled thread has recovered.
In contrast to a fine-grained approach, in a coarse-grained approach, the threads without stalls can be executed completely without any interruption until a costly stall is encountered.
The main disadvantage of coarse-grained multithreading is that, when a thread encounters a costly stall, its instruction pipeline which is carrying out the execution gets frozen. The new thread which replaces this frozen thread has to wait until the emptied pipeline is filled, prior to completion of instruction execution. The time delay is significant and appears to be an overhead. Coarse-grained multithreaded approach doesn't have the ability.
The key advantage of coarse grained multithreading is that it stops the execution of threads which encounter costly stall and replaces with a new thread. A costly stall consumes more clock cycles when compared to the time taken to remove a frozen thread and replace a new thread into the pipeline. Simultaneous Multithreading (SMT): In addition to the two multithreading approaches there is another approach which is implemented on a superscalar multiprocessor. A superscalar processor is a processor which issues multiple issues at the same time exploiting Instruction Level Parallelism (ILP) where multiple instructions are executed at the same time. A
Superscalar processors generally operate on more than one scalar. By scalar, we meant a single unit of data. This approach is a variation of fine-grained multithreading and is called
Simultaneous Multithreading (SMT). Simultaneous multithreading allows multiple threads to
execute at the same time and also let multiple instructions to get executed at the same time by a processor.
By allowing multiple instructions to be executed on multiple independent threads, a higher degree of efficiency is achieved. Instructions are dynamically scheduled so that a processor can run multiple instructions on multiple threads without conflicts and dependencies. To maintain the execution of multiple threads on multiple instructions, the registers are renamed continuously so to avoid confusion between two threads.