answersLogoWhite

0


Best Answer

You haven't told us what members "these objects'" have nor on what architecture these objects are being represented, so it is not possible to say how they are physically represented.

At the machine level, all objects are represented as a binary value consisting of one or more bytes. The length of a byte is entirely machine-dependent, but in the C language a byte is always at least 8 bits in length. Knowing the length of a byte on a given architecture helps us determine how many bits an object requires in its representation.

Every architecture has several "native" data types upon which it can physically operate upon. Typically, these data types are 1, 2, 4 or 8 bytes in length, however the length alone doesn't tell us what is actually being represented; for that we really need to know the actual type. For example, on a 32-bit architecture, a normalised memory address can be represented in 4 bytes. Memory addresses are essentially unsigned integers (positive numbers), however we can also use 4 bytes to represent a 32-bit signed integer, a 32-bit floating point value, an array of four 1-byte elements or an array of two 2-byte elements. We can even use a 32-bit value to represent complex machine-level data, where some bits are used as Boolean "flags" (or DIP switches that can be on or off) while others represent multi-bit binary values.

In other words, the exact same binary value can have many different meanings depending on which type is actually being represented by that value.

In C Programming, the machine-level data types are represented by primitive data types such as char, int, bool, double and float. User-defined types build upon these primitive data types through the use of struct and union data types as well as arrays of a type. We also have a means of representing a memory address using a pointer variable (of a given type), which allows us to refer to an object (of the given type) elsewhere in memory.

Once we understand how the C data types map to the underlying architecture we can better understand how our objects are actually being represented. In the absence of all other information, all we can really say is that an object is represented by an array of one or more bytes which we can either interpret as being a single numeric value or as a sequence of (smaller) numeric values. The length of that array (in bytes) can be obtained using the sizeof(T) operator for any given type T. However, some of those bytes may not hold any actual data; they exist purely for memory-alignment purposes. That is, a 2-byte data type is typically aligned upon a 2-byte memory boundary, while a 4-byte data type is typically aligned upon a 4-byte boundary. Thus a 5-byte object may consume 8 bytes and its important that we understand where those padding bytes reside in order to interpret the binary value(s) correctly.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: If each feature is a binary value please list these objects' representation?
Write your answer...
Submit
Still have questions?
magnify glass
imp