Thursday, 19 June 2014

Download Mastering c++ by KR Venugopal in pdf

This book covers concepts such as programming paradigms, the need for OOPs technology, extending C/C++ at a glance, fundamental constructs of the C++ language, classes and objects, inheritance, polymorphism, generic programming, streams computations, fault tolerant programming with exceptions. 


Mastering C++ 2nd Edition, authored by K. R. Venugopal and Rajkumar Buyya, is a comprehensive book for student learning the C++ program. It comprises of case studies that help give a better understanding of the subject. It includes an introduction to new topics regarding the program. The book is essential for student who are intend on mastering the C++ language. 
About K. R. Venugopal
K. R. Venugopal is the Principal at University Visvesvaraya College of Engineering, Bangalore University. 
About Rajkumar Buyya
Dr. Rajkumar Buyya is a Professor of Computer Science and Software Engineering and the director of Cloud Computing and Distributed Systems Laboratory at the University of Melbourne, Australia. 



DOWNLOAD PDF FILE



Monday, 16 June 2014

Download jumping into c++ in PDF

Hello All,

you can download Jumping Into C++ from below link.It is very useful for beginner.It gives all learning funda in step by step. Jumping into C++ is a great companion book to an intro C++ class. Drawing from my years as a teaching fellow at Harvard, Jumping into C++ covers all the topics you'll hear about in lecture: intro to C++, loops, functions, pointers, linked lists, binary trees and gives you in depth explanations for all of them.
Don't struggle trying to figure out how to write your homework problem sets--in this book, you will get tips on writing and designing programs with examples worked through.
If your instructor isn't clear, and the assignments make no senseJumping into C++ will provide welcome clarity.


DOWNLOAD LINK

http://www.cprogramming.com/c++book/jumping_into_c++_sample.pdf

OR

https://onedrive.live.com/redir?resid=c36beb9c52a24ba6!344&authkey=!AF7ac9ev3pC8Q4A&ithint=file%2cpdf

CUDA Technology In Graphics Processing Unit(GPU)

CUDA (Compute Unified Device Architecture) is a parallel computingplatform and programming model created by NVIDIA and implemented by the graphics processing units (GPUs) that they produce.[1] CUDA gives program developers direct access to the virtual instruction set and memory of the parallel computational elements in CUDA GPUs.
Using CUDA, the GPUs can be used for general purpose processing (i.e., not exclusively graphics); this approach is known as GPGPU. Unlike CPUs, however, GPUs have a parallel throughput architecture that emphasizes executing many concurrent threads slowly, rather than executing a single thread very quickly.
The CUDA platform is accessible to software developers through CUDA-accelerated libraries, compiler directives (such as OpenACC), and extensions to industry-standard programming languages, including CC++ and Fortran. C/C++ programmers use 'CUDA C/C++', compiled with "nvcc", NVIDIA's LLVM-based C/C++ compiler,[2] and Fortran programmers can use 'CUDA Fortran', compiled with the PGI CUDA Fortran compiler from The Portland Group.
In addition to libraries, compiler directives, CUDA C/C++ and CUDA Fortran, the CUDA platform supports other computational interfaces, including the Khronos Group's OpenCL,[3] Microsoft's DirectCompute, and C++ AMP.[4] Third party wrappers are also available for PythonPerlFortranJavaRubyLuaHaskellMATLABIDL, and native support in Mathematica.
In the computer game industry, GPUs are used not only for graphics rendering but also in game physics calculations (physical effects like debris, smoke, fire, fluids); examples include PhysX and Bullet. CUDA has also been used to accelerate non-graphical applications in computational biologycryptography and other fields by an order of magnitude or more.[5][6][7][8][9]
CUDA provides both a low level API and a higher level API. The initial CUDA SDK was made public on 15 February 2007, for Microsoft Windows and LinuxMac OS X support was later added in version 2.0,[10] which supersedes the beta released February 14, 2008.[11]CUDA works with all Nvidia GPUs from the G8x series onwards, including GeForceQuadro and the Tesla line. CUDA is compatible with most standard operating systems. Nvidia states that programs developed for the G8x series will also work without modification on all future Nvidia video cards, due to binary compatibility.

Wednesday, 4 June 2014

What Is Embedded C? Difference between C and Embedded C.

EMBEDDED C

During infancy years of microprocessor based systems, programs were developed using assemblers and fused into the EPROMs. There used to be no mechanism to find what the program was doing. LEDs, switches, etc. were used to check correct execution of the program. Some ‘very fortunate’ developers had In-circuit Simulators (ICEs), but they were too costly and were not quite reliable as well.
 
As time progressed, use of microprocessor-specific assembly-only as the programming language reduced and embedded systems moved onto C as the embedded programming language of choice. C is the most widely used programming language for embedded processors/controllers. Assembly is also used but mainly to implement those portions of the code where very high timing accuracy, code size efficiency, etc. are prime requirements.
 
Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write (portable) operating systems. Originally it was implemented on UNIX operating systems. As it was intended for operating systems development, it can manipulate memory addresses. Also, it allowed programmers to write very compact codes. This has given it the reputation as the language of choice for hackers too.
 
As assembly language programs are specific to a processor, assembly language didn’t offer portability across systems. To overcome this disadvantage, several high level languages, including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but couldn’t find wide acceptance. Amongst those, C got wide acceptance for not only embedded systems, but also for desktop applications. Even though C might have lost its sheen as mainstream language for general purpose applications, it still is having a strong-hold in embedded programming. Due to the wide acceptance of C in the embedded systems, various kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated development of embedded systems using C.
 
Subsequent sections will discuss what is Embedded Cfeatures of C language, similarities and difference between C and embedded C, andfeatures of embedded C programming.
 
EMBEDDED SYSTEMS PROGRAMMING
Embedded systems programming is different from developing applications on a desktop computers. Key characteristics of an embedded system, when compared to PCs, are as follows:
·         Embedded devices have resource constraints(limited ROM, limited RAM, limited stack space, less processing power)
·         Components used in embedded system and PCs are different; embedded systems typically uses smaller, less power consuming components. ·        Embedded systems are more tied to the hardware.
 
Two salient features of Embedded Programming are code speed and code size. Code speed is governed by the processing power, timing constraints, whereas code size is governed by available program memory and use of programming language.  Goal of embedded system programming is to get maximum features in minimum space and minimum time.
 
Embedded systems are programmed using different type of languages:
·           Machine Code
·           Low level language, i.e., assembly
·           High level language like C, C++, Java, Ada, etc.
·           Application level language like Visual Basic, scripts, Access, etc.
 
Assembly language maps mnemonic words with the binary machine codes that the processor uses to code the instructions. Assembly language seems to be an obvious choice for programming embedded devices. However, use of assembly language is restricted to developing efficient codes in terms of size and speed. Also, assembly codes lead to higher software development costs and code portability is not there. Developing small codes are not much of a problem, but large programs/projects become increasingly difficult to manage in assembly language. Finding good assembly programmers has also become difficult nowadays. Hence high level languages are preferred for embedded systems programming.
 
Use of C in embedded systems is driven by following advantages
·      It is small and reasonably simpler to learn, understand, program and debug.
·      C Compilers are available for almost all embedded devices in use today, and there is a large pool of experienced C programmers.
·      Unlike assembly, C has advantage of processor-independence and is not specific to any particular microprocessor/ microcontroller or any system. This makes it convenient for a user to develop programs that can run on most of the systems.
·      As C combines functionality of assembly language and features of high level languages, C is treated as a ‘middle-level computer language’ or ‘high level assembly language’
·      It is fairly efficient
·      It supports access to I/O and provides ease of management of large embedded projects.
 
Many of these advantages are offered by other languages also, but what sets C apart from others like Pascal, FORTRAN, etc. is the fact that it is a middle level language; it provides direct hardware control without sacrificing benefits of high level languages.
 
Compared to other high level languages, C offers more flexibility because C is relatively small, structured language; it supports low-level bit-wise data manipulation.
 
Compared to assembly language, C Code written is more reliable and scalable, more portable between different platforms (with some changes). Moreover, programs developed in C are much easier to understand, maintain and debug. Also, as they can be developed more quickly, codes written in C offers better productivity. C is based on the philosophy ‘programmers know what they are doing’; only the intentions are to be stated explicitly. It is easier to write good code in C & convert it to an efficient assembly code (using high quality compilers) rather than writing an efficient code in assembly itself. Benefits of assembly language programming over C are negligible when we compare the ease with which C programs are developed by programmers.
 
Objected oriented language, C++ is not apt for developing efficient programs in resource constrained environments like embedded devices. Virtual functions & exception handling of C++ are some specific features that are not efficient in terms of space and speed in embedded systems. Sometimes C++ is used only with very few features, very much as C.
 
Ada, also an object-oriented language, is different than C++. Originally designed by the U.S. DOD, it didn’t gain popularity despite being accepted as an international standard twice (Ada83 and Ada95). However, Ada language has many features that would simplify embedded software development.
 
Java is another language used for embedded systems programming. It primarily finds usage in high-end mobile phones as it offers portability across systems and is also useful for browsing applications. Java programs require Java Virtual Machine (JVM), which consume lot of resources. Hence it is not used for smaller embedded devices.
 
Dynamic C and B# are some proprietary languages which are also being used in embedded applications.
 
Efficient embedded C programs must be kept small and efficient; they must be optimized for code speed and code size. Good understanding of processor architecture embedded C programming and debugging tools facilitate this.
 
DIFFERENCE BETWEEN C AND EMBEDDED C
Though C and embedded C appear different and are used in different contexts, they have more similarities than the differences. Most of the constructs are same; the difference lies in their applications.
 
C is used for desktop computers, while embedded C is for microcontroller based applications. Accordingly, C has the luxury to use resources of a desktop PC like memory, OS, etc. While programming on desktop systems, we need not bother about memory. However, embedded C has to use with the limited resources (RAM, ROM, I/Os) on an embedded processor. Thus, program code must fit into the available program memory. If code exceeds the limit, the system is likely to crash.
 
Compilers for C (ANSI C) typically generate OS dependant executables. Embedded C requires compilers to create files to be downloaded to the microcontrollers/microprocessors where it needs to run. Embedded compilers give access to all resources which is not provided in compilers for desktop computer applications.
 
Embedded systems often have the real-time constraints, which is usually not there with desktop computer applications.
 
Embedded systems often do not have a console, which is available in case of desktop applications.
 
So, what basically is different while programming with embedded C is the mindset; for embedded applications, we need to optimally use the resources, make the program code efficient, and satisfy real time constraints, if any. All this is done using the basic constructs, syntaxes, and function libraries of ‘C’.

Tuesday, 3 June 2014

Data Structure and Algorithm

There are numerous types of data structures:
  • An array stores a number of elements in a specific order. They are accessed using an integer to specify which element is required (although the elements may be of almost any type). Typical implementations allocate contiguous memory words for the elements of arrays (but this is not always a necessity). Arrays may be fixed-length or expandable.
  • Records (also called tuples or structs) are among the simplest data structures. A record is a value that contains other values, typically in fixed number and sequence and typically indexed by names. The elements of records are usually called fields ormembers.
  • hash table (also called a dictionary or map) is a more flexible variation on a record, in which name-value pairs can be added and deleted freely.
  • union type specifies which of a number of permitted primitive types may be stored in its instances, e.g. "float or long integer". Contrast with a record, which could be defined to contain a float and an integer; whereas, in a union, there is only one value at a time. Enough space is allocated to contain the widest member datatype.
  • tagged union (also called a variant, variant recorddiscriminated union, or disjoint union) contains an additional field indicating its current type, for enhanced type safety.
  • set is an abstract data structure that can store specific values, without any particular order, and with no repeated values. Values themselves are not retrieved from sets, rather one tests a value for membership to obtain a boolean "in" or "not in".
  • Graphs and trees are linked abstract data structures composed of nodes. Each node contains a value and also one or morepointers to other nodes. Graphs can be used to represent networks, while variants of trees can be used for sorting and searching, having their nodes arranged in some relative order based on their values.
  • An object contains data fields, like a record, and also contains program code fragments for accessing or modifying those fields. Data structures not containing code, like those above, are called plain old data structures.
Many others are possible, but they tend to be further variations and compounds of the above listed types.






Algorithms

An algorithm is an effective method expressed as a finite list[1] of well-defined instructions[2] for calculating a function.[3] Starting from an initial state and initial input (perhaps empty),[4] the instructions describe a computation that, when executed, proceeds through a finite[5] number of well-defined successive states, eventually producing "output"[6] and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.[7]

Sunday, 1 June 2014

Difference Between RS232 and UART

UART (or USART) - Universal (Serial) Asynchronous Receiver/Transmitter
This is, essentially, a serial communications interface. The "universal" part means that it can be configured to support many different specific serial protocols. The term is generic, and does not represent a specific standard. At minimum it means that it has a TX and an RX line, which sends a serial data stream and receives a serial data stream.
RS-232 - A standard defining the signals between two devices, defining the signal names, their purpose, voltage levels, connectors and pinouts.
This is a specific interface standard that allows for equipment interoperability. While two pieces of hardware may have UARTs, you don't know that they'll connect without damage, or communicate properly unless you know they have the same pinout and voltage standards, or include a converter or specially wired cable specific to the interconnection of these two specificl devices. To avoid the need for special converters or cables, the manufacturers may choose to follow the RS-232 standard. You know, then, that a standard RS-232 cable will connect the two.
However, neither the UART, nor the RS-232 standard define what is sent on the TX and RX lines. Generally, when people use RS-232, they use a simple 8 bit NRZ encoding with one start bit and one stop bit. Most equipment today manufactured uses this encoding, but there's no requirement to do so. You can find older equipment that includes parity bits, or uses 7 or 9 bits. The UART can be configured to support these various protocols on its TX and RX lines.
UARTs do not typically interface directly with RS-232. You will need to convert the output of the UART to the +/-12V standard that RS-232 requires. A complete RS-232 interface will typically involve both a UART and an RS-232 level converter. Further, the RS-232 standard includes the definition of several other signalling pins besides TX and RX, which you may need to use depending on the equipment you need to connect to. These will also need to be level converted, and your UART may, or may not, support these signals. If it does not you will have to control them with your software/firmware directly.
So while a UART may help you implement an RS-232 interface, it is not an RS-232 interface itself.

UART is responsible for sending and receiving a sequence of bits. At the output of a UART these bits are usually represented by logic level voltages. These bits can become RS-232, RS-422, RS-485, or perhaps some proprietary spec.
RS-232 specifies voltage levels. Notice that some of these voltage levels are negative, and they can also reach ±15V. Larger voltage swing makes RS-232 more resistant to interference (albeit only to some extent).
A microcontroller UART can not generate such voltages levels by itself. This is done with help of an additional component: RS-232 line driver. A classic example of an RS-232 line driver is MAX232. If you go through the datasheet, you'll notice that this IC has a charge pump, which generates ±10V from +5V.