Explore chapters and articles related to this topic
Design of Molecular Integrated Circuits
Published in Sergey Edward Lyshevski, Molecular Electronics, Circuits, and Processing Platforms, 2018
A program is a set of instructions that one writes to define what the circuit should do. For example, if the IC consists of on and off logic switches, one can assign that the first and second switches are off, while the third to eighth switches are on in order to have 8-bit signal 00111111. The program commands millions of switches, and a program should be written in the circuit-level language. For ICs, software developments have progressed to high-level programming languages. A high-level programming language allows one to use a vocabulary of terms, for example, read, write, or do, instead of creating the sequences of on-off switching that implements these functions. All high-level languages have their syntax, provide a specific vocabulary, and assign explicitly defined set of rules for using their vocabulary. A compiler is used to translate (interpret) the high-level language statements into machine code. The compiler issues error messages if the programmer uses the programming language incorrectly. This allows one to correct the error and perform other translation by compiling the program. Programming logic is an important issue because it involves executing various statements and procedures in the correct order to produce the desired results. One must use the syntax correctly and execute a logically constructed, sound program. Two commonly used approaches to write computer programs are procedural and object-oriented programming. Through procedural programming, one defines and executes computer memory locations (variables) to hold values and writes sequential steps to manipulate these values. The object-oriented programming is the extension of the procedural programming because it involves creating objects (program components) and creating applications that use these objects. Objects are made up of states that describe the characteristics of an object.
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
Procedural programming is algorithmic by nature with each subprogram or procedure in a set of code often corresponding to a single step in a global algorithm that has been designed to solve the problem at hand. This approach lends itself to code reuse in that subroutines and functions can be employed again when similar subproblems arise. A disadvantage is that, unless safeguards are put in place, data can move freely across subprograms in a manner that allows for possibly inappropriate access or use.
DO-332 and Object-Oriented Technology and Related Techniques
Published in Leanna Rierson, Developing Safety-Critical Software, 2017
The feature that distinguishes OOT is the use of classes to define objects along with the ability to create new classes via subclassing. In procedural programming, a program’s behavior is defined by functions, and the state of a running program is defined by the contents of the data variables. In object-oriented programming, functions and data that are closely related are tightly coupled to form a coherent abstraction known as a class…
Multidual Sensitivity Method in Ray-Tracing Transport Simulations
Published in Nuclear Science and Engineering, 2021
Matthew R. Balcer, Harry Millwater, Jeffrey A. Favorite
The implementation of multidual differentiation in existing code is general. The following description applies to procedural programming languages such as Fortran or C, but can be extended to object-oriented languages like Python or C++. A detailed description of the multidual algebra library used here, MultiZ, is given in Ref. 22. For all variables of interest, real-valued variable types are transformed to multidual types. That is, a real number is declared as a multidual number, a vector is declared as a multidual vector, and a matrix is declared as a multidual matrix. Similarly, any functions that use these variables are also declared as multidual. All remaining variables are left unchanged. Multidual vectors and matrices are then allocated based on the number of nonreal parts of the multidual step. The external library handles array indexing so an interface, defined in the external library, is called when assigning or retrieving positions of arrays. A nonreal step is applied to each variable of interest where they are first calculated, following Eq. (14). Finally, sensitivities are calculated by extracting nonreal parts of the output using Eq. (14). A numerical example of a multidual code conversion is shown in Appendix A.