Answer:
cience
Explanation:
From the question, the string variable str was initialized to "Computer Science:
str.substring(10) implies that we get a substring starting from the character at the 10th index till the last index
In this case, the 10th index character is c
So, the instruction will return cience
Answer:
Explanation:
(a) Given data:
Instruction pipeline with 4 phases.
80 instruction
The number of cycles if the processor were pipelined :
80-1 = (79) instruction takes only 1 extra cycle to complete.
So, cycles counts = 4 + (79) = 83 cycles.
The number of cycles if the processor were not pipelined.
Each instruction takes 4 cycles to complete.
So, cycle counts = 80 * 4 = 320 cycles.
(b) One of the main problems of conditional branching in pipelines is the delay it gives even after the branch target buffer.
In pipeline, conditional branches depend on the codes which are still in estimation.
(c) Two ways to deal with problem arising due to conditional branching are as follows :
1. Delayed Branching
2. Multiple Condition Codes
Answer:
Hi, for this exercise we have two laws to bear in mind:
Morgan's laws
NOT(А).NOT(В) = NOT(A) + NOT (B)
NOT(A) + NOT (B) = NOT(А).NOT(В)
And the table of the Nand
INPUT OUTPUT
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
Let's start!
a.
Input OUTPUT
A A A NAND A
1 1 0
0 0 1
b.
Input OUTPUT
A B (A NAND B ) NAND (A NAND B )
0 0 0
0 1 0
1 0 0
1 1 1
C.
Input OUTPUT
A B (A NAND A ) NAND (B NAND B )
0 0 0
0 1 1
1 0 1
1 1 1
Explanation:
In the first one, we only need one input in this case A and comparing with the truth table we have the not gate
In the second case, we have to negate the AND an as we know how to build a not, we only have to make a nand in the two inputs (A, B) and the make another nand with that output.
In the third case we have that the OR is A + B and we know in base of the morgan's law that:
A + B = NOT(NOT(А).NOT(В))
So, we have to negate the two inputs and after make nand with the two inputs negated.
I hope it's help you.
Answer: -17
Explanation:
Our random number is 17. Let's go through line by line.
- value is a random number picked which is 17
- valueB = 17 / 2 = 8.5
- If value is greater than 0 AND value has a remainder of 1, we will set the value to value* -1.
- Value is now 17 * -1 = -17
Let's quickly calculate value mod 2. 17 % 2 = is 1. If you're wondering how we did that, the remainder after dividing 8 into 17 twice is 1, because 17 - 16 = 1.
We stop after line 4 because we stop the conditional statement after one condition is filled.
The header content of a web-page can contain meta tags that classify the page. Search engines use this information.