Friday, April 20, 2012

converter decimal, biner, oktal


Exercise 1

A.      Convert into decimal
1.       (110010101) = (1x25)+
(1x28)+(1x27)+(0x26)+(0x25)+(1x24)+(0x23)+(1x22)+(0x21 )+(1x20)= (256) + (128) + (0) +(0) + (16) + (0) + (4) + (0) + (10) =(405)10

2.       (001000100)2=(0x28)+
(0x28)+(0x27)+(1x26)+(0+25)+(0+24)+(0x23)+(1x22)+(0x21)+(0x20) = (0) + (0) + (64) + (0) + (0) + (0) + (4)  + (0) + (0) = (68)10

3.       (4562)8=(4x83)+(5x82)+(6x81)+(2x80) = (2048) + (320) + (48) + (2) = (2418)10

4.       (361)8=(3x82)+(6x81)+(1x80) =  (192) + (48) + (1) = (241)10


5.       (34510)16=(3x164)x(4x163)+(5x162)+(1x161)+(0x160) = (196608) + (16384) + (1280) + (16) + (0) = (214288)10

6.       (A134)16=(10x163)+(1x162)+(3x161)+(4x160) = (40960) + (256) + (48) + (4) = (41264)10

Java programming language

The first Java programming language was born from the Green Project, which runs for 18 months, from early 1991 until the summer of 1992. The project is not using a version called Oak. The project was initiated by Patrick Naughton, Mike Sheridan, James Gosling and Bill Joy, along with nine other programmers from Sun Microsystems. One result of this project is the Duke mascot created by Joe Palrang. Project meeting took place in an office building on Sand Hill Road Menlo Park. Around the summer of 1992 the project was closed by generating a Java program's first Oak, which is intended as a hardware controller with touch screen technology (touch screen), such as the PDA is today. This new technology called "* 7" (Seven Star).

Thursday, April 19, 2012

Selection in JAVA programming language

Java mengguanakan selection to solve the problem of the choice process. In the programming is not all a matter of choice can be done sequentially. Sometimes we come across cases that require a selection process. Selection statement will be useful for such cases. In the java programming language statements, there are two kinds of selection, namely IF and SWITCH. More details will be explained as follows.The first is a selection statement is by using IF. IF statement will have some shape, form the first is IF with a choice. General form as follows.
If (condition)Statements;
Description:• Conditions are used to determine the decision keputasan. If the condition is true then the statement of work• The statement, contains the commands and will be executed if the condition is true.Statements herein may beupa single or multipleThe second form of selection virgin IF statement is IF and ELSE statements. This statement will have two choices, if the condition is true then it is done first and if the statement is false that statement 2 is done. Statements 1 and 2 is a compound statement.

 
If (condition)Statement 1;ElseStatement 2;
Statement is true if else statements are only able to complete the two options. But by making the statement if the berjengjang, then we can manipulate in order to be in use if statements untukmemecahkan problem a lot of options. The statement is the if statement in the if, if in the if statement is often referred to if any. The form:

  
If (condition 1)Statement 1;
         
else if (condition 2)Statement 2;
        
else if (condition 3)Statement 3;
       
else if (kondisi_n)Pernyataan_n;
       
elsePernyataan_x;
This form is useful to resolve any possible act of, the settlement made secar rise.Examples of program.java.until.Scanner import;public class IfNilai{public static void main (String arcgs [])int nil;nil_huruf char = 'E';System.out.print ("Enter number:");masuk.nextInt nil = ();if ((nil> = 0) && (nil <= 20))nil_huruf = 'E';else if ((nil> 20) && (nil <= 40))nil_huruf = 'D';else if ((nil> 40) && (nil <= 60))nil_huruf = 'C';else if ((nil> 60) && (nil <= 80))nil_huruf = 'B';else if ((nil> 80) && (nil <= 100))nil_huruf = 'A';elseSystem.outprintln ("either enter the value");System.out.println ("value of the letter:" + nil_huruf);}}

Tuesday, April 10, 2012

SWITCH statement in JAVA programming

The second statement is a SWITCH statementThe switch statement is a statementused to execute one of the statements of several possible statementsbased on the value of an expression and the selectorsEach phrase is expressed by a constantinteger valuesuch as a value of type byteshortor char in.

switch (expression)
{
ungkapan1 case:
pernyataan1;
break;
ungkapan2 case:
pernyataan2;
break;
. . . . . . . . . . . . . . . .
default:
pernyataan_x;
}

information
 Ungkapan1ungkapan2 and so done in sequence starting from the firstthe statementthat follows the suitable sekirannya cese will be executed
 Break ditmukan of the switch statement ends execution
 Default will only be executed if the expression in the cese no match.

java.until.Scanner import;
publib class Arithmetic {
public static void main (Sting args []) {
float result;
Data = new Scenner Scenner (System.in);
int bil1bil2;
String op;
Char operator;
System.out.print ("Enter 1 bil:");
bil1 = data.nextInt ();
System.out.print ("enter bil 2:");
bil2 = data.nextInt ();
System.out.print ("enter the operator:");
op = data.next ();
operaor = op.charAt (0);
switch (operator) {
case '*': result = bil1 * bil2break;
case '/': result = (floatbil1 / bil2break;
case '%': result = bil1bil2break;
case '+': result + = bil1 bil2break;
case '-': result = bil1 - bil2break;
defaultresult = 0;
}
System.out.println ("result of operation is =+ result);
}
}

Thursday, March 29, 2012

efforts to improve computer performance

1. pipeline is a means used to do some work together but in different stages that are drawn to continue / continued on the processing unit. In order for faster processing.

2. using the on board cache is located on the motherboard with the higher sispek
3. on board L1 and L2 cache in the processor must use the sispek higher, and usually are relatively more expensive.
4. Branch prediction has a branch prediction.
5. Data flow analysis to analyze data that do not need to be used in order to be deleted and can speed up computer performance. Because when the data on our computers the less the performance of the computer more quickly.
6. Speculative execution Speculative execution data.