Question

In: Computer Science

* What are the five notational systems? and what they do? * What are the five...

* What are the five notational systems? and what they do?

* What are the five fundamentals data types? and what they do?

* What is the difference between compiled languages and interpreted languages

give some examples of interpreted languages

* What a query language does

* which programming language is best for direct hardware access

Solutions

Expert Solution

What are the five notational systems? and what they do?

Ans: The five notational system are

a)BINARY b) HEXADECIMAL c) DECIMAL d)Octal e)ASCII and UNICODE

A) BINARY:

  • Number expressed in the base-2 numeral system
  •   Uses only 2 symbols:0 &1
  •   Basis of all binary code

how they work

  • 0-OFF and 1-ON
  • flow or restriction of flow moves through transistor
  • Logic gates are created

Eg:

Let’s do it with binary 1010:
0 × 20 = 0
1 × 21 = 2
0 × 22 = 0
1 × 23 = 8

Add 0+2+0+8 and you get decimal 10.

Representation:

Decimal Binary
0 00000000
1 00000001
2 00000010
3 00000011
4 00000100
5 00000101
6 00000110

Applications:

Binary is found in computer technology. All computer language and programming is based on the 2-digit number system used in digital encoding (is the process of taking data and representing it with discreet bits of information).

The most common application for the binary number system can be found in computer technology. All computer language and programming is based on the 2-digit number system used in digital encoding. Digital encoding is the process of taking data and representing it with discreet bits of information. These discreet bits consist of the 0s and 1s of the binary system.

B) Hexadecimal numbering system(base-16)

  • The one main disadvantage of binary numbers is that the binary string equivalent of a large decimal base-10 number can be quite long.
  • The “Hexadecimal” or simply “Hex” numbering system uses the Base of 16 system and are a popular choice for representing long binary values because their format is quite compact and much easier to understand compared to the long binary strings of 1’s and 0’s.
  • Then in the Hexadecimal Numbering System we use the numbers from 0 to 9 and the capital letters A to F to represent its Binary or Decimal number equivalent, starting with the least significant digit at the right hand side.

HEXADECIMAL NUMBERING SYSTEM:

Decimal Number 4-bit Binary Number Hexadecimal Number
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

Applications:

A computer understands information composed of only Zeros and Ones. Therefore, when we type some letters or words, data is processed by the computer in the form of 0s and 1s. A computer can understand positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number. Computer is usually designed to process hexadecimal number.

For example, the images you see on your computer screen have been encoded with a binary line for each pixel. If a screen is using a 16-bit code, then each pixel has been told what color to display based on which bits are 0s and which bits are 1s. As a result, 2^16 represents 65,536 different colors! We also find the binary number system in a branch of mathematics known as Boolean algebra. This field of mathematics is concerned with logic and truth values. Here, statements that are either true or false are then assigned a 0 or 1.

Hexadecimal numbering system is often used by programmers to simplify the binary numbering system. Since 16 is equivalent to 24, there is a linear relationship between the numbers 2 and 16.

This means that one hexadecimal digit is equivalent to four binary digits. Computers use binary numbering system while humans use hexadecimal numbering system to shorten binary and make it easier to understand.

Hexadecimals are used in the following:

  • To define locations in memory. Hexadecimals can characterise every byte as two hexadecimal digits only compared to eight digits when using binary.
  • To define colours on web pages. Each primary colour – red, green and blue is characterised by two hexadecimal digits. The format being used is #RRGGBB. RR stands for red, GG stands for green and BB stands for blue.
  • To represent Media Access Control (MAC) addresses. MAC addresses consist of 12-digit hexadecimal numbers. The format being used is either MM:MM:MM:SS:SS:SS or MMMM-MMSS-SSSS. The first 6 digits of the MAC address represent the ID of the adapter manufacturer while the last 6 digits represent the serial number of the adapter.
  • To display error messages. Hexadecimals are used to define the memory location of the error. This is useful for programmers in finding and fixing errors.

c)Decimal numbering system

  • they represent the counting number.
  • Numbers 0-9 is the base 10 numbering system
  • it is base 10

Application:

We use decimals every day, while dealing with money, weight, length etc. Decimal numbers are used in situations where more precision is required, than the whole numbers can provide. For example, when we calculate our weight on the weighing machine, we do not always find the weight equal to a whole number on the scale. In order to know our exact weight we must understand what the decimal value on the scale means. This section deals with the concept of decimals in three important fields of our daily life.

d) Octal number system

Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with 0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has only 8 digits.

Applications:

Octal used to be used widely within IT basically how hexadecimal is used today. It was used as an ideal abbreviation of binary because the bit size (amount of bits that could be handled at one go) of the CPUs that were used at the time that being 26 and 36 bit. After CPUs converted to bit sizes of 32 and 64 bit octal was no longer utilised because, though both are still dividable by 8 they can also be divided by 16 which is far more efficient. There are some places however where octal is still widely utilised including within file permissions within unix (the source code for linux, mac os and android along with other operating systems) to avoid having to add support for symbols for hexadecimal. It is also used within digital displays that also have no support for symbols.

The PDP-11 computer made by the Digital Equipment Corporation used the octal numeric system exclusively for displaying memory addresses and content.

Unix file system permissions have three sets (user, group, others) of three bit permissions (read, write, execute), which is naturally represented in octal.

The use of octal numbers has declined as most modern computers no longer base their word length on multiples of three bits, (they are based on multiples of four bits, so hexadecimal is more widely used).

e) ASCII :

American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Most modern character-encoding schemes are based on ASCII, although they support many additional characters.

Numerals (often called numbers in Unicode) are characters or sequences of characters that denote a number. The Hindu–Arabic numeral system (base-10) is used widely in various writing systems throughout the world and all share the same semantics for denoting numbers.

What is the use Notational systems:

ASCII and Unicode:

  • They are used for data representation.
  • Used to store, transmit data

Q2) What are the five fundamentals data types? and what they do?

Data types

Variables come in all shapes and sizes. Some are used to store numbers, some are used to store text and some are used for much more complicated types of data.

The five fundamental datatypes:

  • String (or str or text). Used for a combination of any characters that appear on a keyboard, such as letters, numbers and symbols.
  • Character (or char). Used for single letters.
  • Integer (or int). Used for whole numbers.
  • Float (or Real). Used for numbers that contain decimal points, or for fractions.
  • Boolean (or bool). Used where data is restricted to True/False or yes/no options

eg

Title price no of books Favorite
c programming 500 2 True
java programming 499.25 5 false

title: String

price: real or float

no of book: integer

favorite:boolean

In computer programming, data type is a classification that specifies to compiler or interpreter which type of data user is intending to use.
There are two types of data types –

  1. Primitive/Fundamental data type
  2. Derived data type

Why do we need data types?

Data types are especially important in programmming because it is a strongly typed language. Thus, strong type checking helps prevent errors and enhances reliability. to enable strong type checking, all variables, expressions, and values have a type.

Q3)

What is the difference between compiled languages and interpreted languagesgive some examples of interpreted languages?

compiled language

A compiled language is a programming language whose implementations are typically compilers and not interpreters.In this language, once the program is compiled it is expressed in the instructions of the target machine.There are at least two steps to get from source code to execution.In this language, compiled programs run faster than interpreted programs.In this language, compilation errors prevent the code from compiling.The code of compiled language can be executed directly by the computer’s CPU.

  Example of compiled language – C, C++, C#, CLEO, COBOL, etc.

Interpreted language:

An interpreted language is a programming language whose implementations execute instructions directly and freely, without previously compiling a program into machine-language instructions.While in this language, the instructions are not directly executed by the target machine.There is only one steps to get from source code to execution.While in this language, interpreted programs can be modified while the program is running.In this languages, all the debugging occurs at run-time.A program written in an interpreted language is not compiled, it is interpreted.This languages delivers relatively slower performance.

  Example of Interpreted language – JavaScript, Perl, Python, BASIC, etc.

Q4)

What a query language does?

  A query language is a specialized programming language for searching and changing the contents of a database.In regular English, a query means a request for information. This is handy for data manipulation – adding, removing, and changing data. we write our query based on a set of pre-defined code, so your database understands the instruction. We refer to this code as the query language.The standard for database management is Structured Query Language (SQL). Remember, SQL is different from MySQL: the former is the query language, the latter is the software which uses the language. While it is true that SQL is the most popular choice among database software, it is definitely not the only one. Several others are AQL, Datalog, and DMX.

How Does Query Work?

It gives meaning to the code used in any query language. Be it SQL or anything else, both the user and the database can always exchange information as long as they ‘speak’ the same language.

eg:

Selecting only the “Name” and “Occupation” columns from the “Participant” table.
SQL Statement:
SELECT Name, Occupation FROM Participant

Q5)

which programming language is best for direct hardware access?

Assembly language:

  

Assembly language was created as an exact shorthand for machine level coding.Assembly Language is a low-level programming language. It helps in understanding the programming language to machine code. In computer, there is assembler that helps in converting the assembly code into machine code executable. Assembly language is designed to understand the instruction and provide to machine language for further processing. It mainly depends on the architecture of the system whether it is the operating system or computer architecture.

Assembly Language mainly consists of mnemonic processor instructions or data, and other statements or instructions. It is produced with the help of compiling the high-level language source code like C, C++. Assembly Language helps in fine-tuning the program.

Advantages

  1. It allows complex jobs to run in a simpler way.
  2. It is memory efficient, as it requires less memory.
  3. It is faster in speed, as its execution time is less.
  4. It is mainly hardware oriented.
  5. It requires less instruction to get the result.
  6. It is used for critical jobs.
  7. It is not required to keep track of memory locations.
  8. It is a low-level embedded system.

Disadvantages

  1. It takes a lot of time and effort to write the code for the same.
  2. It is very complex and difficult to understand.
  3. The syntax is difficult to remember.
  4. It has a lack of portability of program between different computer architectures.
  5. It needs more size or memory of the computer to run the long programs written in Assembly Language

eg:

global _main
extern _printf
section .text
_main:
push    message
call    _printf
add     esp, 4
ret
message:
db 'Hello, World!', 10, 0


Related Solutions

SHORT ANSWERS a. How do we evaluate outcomes of economic systems? State the five performance criteria...
SHORT ANSWERS a. How do we evaluate outcomes of economic systems? State the five performance criteria and briefly explain each. b. Describe the feudalist economic system. What were its main characteristics? Why did it collapse? c. Describe the EFO model. How does it work? What were the reasons for its implementation? What is its underlying purpose? Make sure you clearly explain how the mechanism works. ESSAY TOPICS A. Market failures are considered a weakness of the capitalist economic system. What...
Identify five of the systems that are necessary for pump optimisation
Identify five of the systems that are necessary for pump optimisation
What are the five principles of ethical leadership? How do these principles mesh with Weinstein’s Five...
What are the five principles of ethical leadership? How do these principles mesh with Weinstein’s Five Principles of Ethical Intelligence?
Indirect detection systems and direct detection systems. What do we mean? (Bioinspired Vision Question)
Indirect detection systems and direct detection systems. What do we mean? (Bioinspired Vision Question)
What are five things you can do before an earthquake, and five things after an earthquake...
What are five things you can do before an earthquake, and five things after an earthquake strikes that will become part of your earthquake preparedness plan?
What are trophic cascades and how do they explain connected biological systems?
What are trophic cascades and how do they explain connected biological systems?
Entropy permeates our universe. Five systems are listed below. Pick three systems from the list or...
Entropy permeates our universe. Five systems are listed below. Pick three systems from the list or pick two systems from the list and come up with a third system of your own. For each system you choose, give an example of something that could happen to increase the entropy of that system and explain why entropy increases. Systems: -An automobile -The human body -A building -An ocean -A solar system
What physical systems do the microcanonical, canonical and grand canonical ensembles describe
What physical systems do the microcanonical, canonical and grand canonical ensembles describe and what is the probability for a system to be in a given microstate in each ensemble?
What are enterprise systems and how do you perform risk analyses on them?
What are enterprise systems and how do you perform risk analyses on them?
Which electoral systems do you believe is the best for the US? What are some of...
Which electoral systems do you believe is the best for the US? What are some of the strength of the other systems, and what are some of the weaknesses? Should the US modify its electoral processes?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT