Sunday, 21 October 2012

Arithmetic for Computers

Hello! We’re back again, now bringing up the second topic to be discussed about. We picked the second topic from our semester’s syllabus that is, Arithmetic for Computers (Number Systems and Operations)

From what we understand from the exact definition of arithmetic, it is actually the oldest and most elementary branch of mathematics that is used by almost every single studying person, for tasks ranging from simple day-to-day counting to advanced science and business calculations. It includes the study of quantity, especially as the result of operations that combine numbers. In common usage, it refers to the simpler properties when using the traditional operations of addition, subtraction, multiplication and division with smaller values of numbers.
So basically, arithmetic is all about numbers and operations involving numbers. As we always know, we humans use the decimal number system to perform arithmetic operations including every numbers to infinity. On the other hand, not for the computers, that uses the binary system, containing only two digits that are 0 and 1. We need a way to convert numbers from one system to another in order to allow computers to understand us.
All the number systems we use practically operate on some basic principles where each of it has a base as we will look at decimal with base 10, binary with base 2 and hexadecimal  owning base 16. The base denotes the number of digits and the powers to be used. Base 10 has 10 digits that are numbered from 0-9 and uses the powers of 10. However, base 2 has 2 digits that numbered from 0-1 and uses powers of 2 whereas base 16 has 16 digits which numbered from 0-F (where the letters A-F serve as the digits following 9), and uses the powers of 16.
Other than that, each of these systems of number is a positional notation system meaning that the location of a digit in the number determines its value. As an example, the value of 6 in the decimal number 631 is not the same as the value of 6 in 361 or 136.

So in this explanation part, we'll be using the decimal number system to show how the positional notation system works. Assuming that we have the number 631, what this number means? Each digit represents that digit itself amplifying the power of 10 represented by its position. Don’t forget that the decimal point is supposed to be on the right of the number if it is not explicitly shown. Starting at the decimal point and moving to the left, the columns represent increasing powers of 10. Now we are showing the steps.

102       101       100
6          3          1

The base of the numbers is 10 because the number is initially in decimal form, and the exponent (the superscript) tells what power of 10. The exponents increase by 1 with every move to the next position to the left. Note that the exponents also decrease by 1 with each column move to the right, so the first position to the right of the decimal place tells how many 10-1's are in the number, and the second position to the right of the decimal place tells how many 10-2's are in the number and so forth for other bases.
Recall that any number to the zeroth power is 1, and any number to the first power is that number itself. So the column labeled 100 denotes how many 1's are in the number, the column labeled 101 represents how many 10's are in the number, and the column labeled 102 shows how many 100's are in the number as shown below;
100's column              10's column                1's column
6                      3                                  1
Thus this number has 1 ones, 3 tens, and 6 hundreds, where
1 x 100 = 1 x 1 = 1
3 x 101 = 3 x 10 = 30
6 x 102 = 6 x 100 = 600
So by summing up all those numbers, we will get the number in base 10.
1 + 30 + 600 = 63110
But we basically do not put the subscript for base 10 because base 10 numbers are the numbers we are always using. On the other hand, we do for the other bases like 100011002, 112358 and AE4316. This is due to the using of these bases that is not too wide excluding for those who are involved with computers.



Operations on Integers
There are some operations in dealing with integers in number system. I’m sure every single studying person learn basic operation involving numbers, right. What else could it be other than addition, subtraction, multiplication, division and in this case we also had to deal with overflow in those operations.
Let’s get started with the simplest operation that is addition. If the yield is out of the range, there will be an overflow. Simply, adding positive and negative operands will result in no overflow. But adding two positive operands will result an overflow, but if only the yield sign is equal to 1. In the other hand, the operation of summing up two negative operands will result an overflow only if the result sign is 0.
Saem goes for subtraction operation of integers. There will be an overflow when the value produced is out of the range. There will be no overflow when the operation involves subtraction of two positive or two negative operands. But if the result sign is 0 after subtracting positive from negative operand, there will be an overflow. The overflow will also exist when the result sign is 1 after subtracting negative from positive operand.

Dealing with Overflow
Here are some ways to handle the overflow cases. Somehow, some languages such as C. will just practically ignore overflow. We can use MIPS addu, addui, subu instructions to deal with it. We can also use other languages as Ada and Fortran. But using these languages require a raising an exception. So it is quite difficult to be settled. We might also use MIPS add, addi, sub instructions for other incentive. Plus, we can invoke exception handler on overflow as one of the ways to deal with it. Next step is just by saving the PC in exception program counter (EPC) register.
As multimedia-majoring students, we absolutely need to know these, that arithmetic is such a basic thing in multimedia. It is the foundation that makes the media up, compiling those media becoming multimedia, such a perfect, attentive presentation medium to be used by us, the users. In this prospect, graphics and media processing operates on vectors of 8-bit and 16-bit data.
Next, let’s move on to multiplication operation of integers. As an example taken from our notes,

The upper operand is called multiplicand while the lower one is known as the multiplier. The length of product is the sum of operand lengths.

The next one is division operation. Note that if the divisor is less than or equal to its dividend bits, it will be 1 bit in quotient, and then subtracting the two operands. Otherwise, the other 0 bit in quotient, we will just bring them down next to dividend bit.


Floating Point

Floating points is the way of representation for non-integral numbers including smallest and largest numbers. As if in scientific notation;
–2.34 × 1056
+0.002 × 10–4
+987.02 × 109

Floating point standard is defined by “IEEE Std 754-1985”. It is developed in response to divergence of representations which is a portability issues for scientific code. IEEE Std 754-1985 is now almost universally adopted. Other than that, there are two ways of representations the floating point standards those are single precision (32-bit) and double precision (64-bit).

Okay! Now we are finished with our short brief explanation about arithmetic involved in computers. We do hope that you understand and the information we have prepared will be able to help you in improving your understanding towards arithmetic Number System. A lot of thanks for spending your precious time to visit our page!
^_^


Monday, 8 October 2012

What is digital logic.

Most of us do not have the basic knowledge in Computer Organization and Architecture.
Hence, in this post, we are going to explain about one of the basic things on how the computer would operate. It is DIGITAL LOGIC.

So, basically, what is Digital Logic?

The theory is " Logic gates (or simply gates) are the fundamental building blocks of digital circuitry. As their name implies, they function by “opening” or “closing” to admit or reject the flow of digital information by using digital electronics, which are ; Gates, Decoders, Multiplexers."

But to make you understand better, ill explain these, a bit more detailed.

Digital logic is the basis for digital computing.It is basic the basic to understanding how circuit and hardware are connected to computer. The signals of digital logic is represented by using numbers which are zeros and ones (0s and 1s).

There are four type of gates; AND, OR, NAND, or NOT gate. These gates are to process signals which represent true or false by using Truth Table. Another ways to process the signal is by using the Boolean Algebra.


/WhatIs/images/and.gif (220 bytes)
AND gate

/WhatIs/images/or.gif (224 bytes)
OR gate

/WhatIs/images/not.gif (240 bytes)
NOT gate

/WhatIs/images/nand.gif (240 bytes)
NAND gate

/WhatIs/images/nor.gif (237 bytes)
NOR gate


TRUTH TABLE

Truth Table provide a method of accessing the validity or invalidity of performing any of the tasks to user requested. Each gates have two or more inputs excepts for NOT because it has only one input. Usually, the inputs are represented by using the letters A, B , and C. While the output is represented by using of any other letters. A Truth Table is the exact way to show the function of the logic gates. It shows the input and the output states for every possible combination. The symbol 0 represents FALSE and 1 represent TRUE.





BOOLEAN 

Boolean Algebra or Boolean Logic resembles the ON and OFF circuit which all the signals are classified as either

 Law:

Identity law: A + 0 = A and A & 1 = A.

Zero and One laws: A + 1 = 1 and A & 0 = 0.
Inverse laws: A + A’ = 1 and A & A’ = 1.
Commutative laws: A + B = B + A and A & B = B & A.

Associative laws: A + (B + C) = (A + B) + C and A & (B & C) = (A & B) & C.

Distributive laws: A & (B + C) = (A & B) + (A & C
and
A + (B & C) = (A + B) & (A + C).

DECODER

A decoder is a circuit that converts code to signals (0s or 1s). For example, a decoder can convert the n-bit input into a binary signal. There are types of decoder, but most of decoders give only one n-input and 2,4,6, ... outputs.

This is the example :




 So, are you clear now? But wait up, we're not done yet. So lets continue to the last digital electronic which is ;


MULTIPLEXER


A multiplexer (MUX)  is a device that select several analog or digital input signals and translate the inputs that has been determined as the output into a single line. So basically, an MUX consusts of 3 parts;
1. A decoder that generates n-signals, which each of it indicates a different input value.
2. An array of AND gates, which each ot it combines one of the inputs with a signal from the decoder.
3. A single LARGE OR gate that incorporates the outputs, of the AND gates.

  





Anddd, we are done! I hope that you have already understood what"Digital Logic" actually is. For more info about the architecture and organization of computer, stay tuned! We have lots to share! Toodles!



Nur Ezany bt Elias
B031210213
BITM S1G2