Introduction to Objects - Computer Science - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Computer Science which includes Bit Adder, Code, Vector, Bcdcarryout, Architecture Behavioral, Component, Signal, Waveform, Logic etc. Key important points are: Introduction to Objects, Containers, Values, Specified Type, Signals, Variables or Constants, Certain Type, Bounds Set, Type Declaration, Different Types

Typology: Slides

2012/2013

Uploaded on 03/23/2013

dhruv
dhruv 🇮🇳

4.3

(12)

194 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to Objects
Objects are the containers for values of a specified type
Objects are either signals, variables or constants
Once an object is declared of a certain type, operations
can be performed on the object within the bounds set
in the type declaration
If objects of different types are mixed or exceed
boundaries set by the type declaration, an error is
displayed
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Introduction to Objects - Computer Science - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Introduction to Objects

  • Objects are the containers for values of a specified type
  • Objects are either signals, variables or constants
  • Once an object is declared of a certain type, operations

can be performed on the object within the bounds set

in the type declaration

  • If objects of different types are mixed or exceed

boundaries set by the type declaration, an error is

displayed

Type Definitions

• Scalar type definition:

  • Physical
  • Floating point
  • Enumeration
  • Integer

• Composite type definition:

  • Array
  • Record

• File type definition

• Subsets of types may also be used

Scalar types - Floating point

  • Floating point type:
    • Defines a collection of numbers that provide an approximation to real numbers
    • Problem: it is not possible for hardware to handle infinitely long real numbers
    • Example:
      • TYPE half_hour IS RANGE 0.0 TO 29.99;

Scalar types - Enumeration

• Enumeration type:

– Permit to define a customized set of values

– The literals can be either identifier literals (letters,

underscores, digits etc.) or character literals

– Example:

• TYPE wire_color IS (red, black, green);

Composite types - Array

• Array type:

– A named array is a collection of elements that are of

the same type

– Arrays may be configured in one or more dimensions.

– Each array element is referenced by one or more index

value

– Example:

  • TYPE array_10 IS ARRAY (0 TO 9) OF integer;

Composite Types - Records

• Records:

– A record is a composite type whose elements can be of

various types

– Its purpose is to group together objects of different types

that can be operated as a single object

– Example:

• TYPE coordinates IS RECORD

• xvalue,yvalue,zvalue:integer;

• END RECORD;

Example

Bit type

• Bit is a type which is defined in the standard in

VHDL

• Bit can only assume the values ‘0’ or ‘1’