8085 program to generate Fibonacci sequence

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

5K+ Views

In this program we will see how to generate Fibonacci sequence.Problem StatementWrite 8085 Assembly language program to generate the first ten elements of the Fibonacci sequence using registers only and store them in memory locations 8050H to 8059H. DiscussionThis program will generate the Fibonacci numbers. The Fibonacci numbers follows this relation F(i) = F(i - 1) + F(i - 2) for all i >2 with F(1) = 0, F(2) = 1.InputIn this case we are not providing any input, this program will generate ten Fibonacci numbers.Flow DiagramProgramAddressHEX CodesLabelsMnemonicsComments800021, 50, 80STARTLXI H 8050H Pointer to the OUT-BUFFER8003AFXRA A Clear accumulator and reg. B800447MOV B, ... Read More

What is difference between UITableViewController and UIViewController?

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

381 Views

UItableViewController and UIViewController are two different objects of iOS UIKit framework. Both are used for different purpose.A UIViewController class manages a ViewContoller which is responsible for actions that happen within that View controller. This class is aware of actions that happen on view controller, like ViewDidLoad, ViewWillApper, ViewDidAppear, ViewWillDisapper, ViewDidDisapper.Whereas, A UITableViewController is responsible for managing a table, it's data and it's events using UITableViewDataSource, UITableViewDelegate.A UITableViewController conforms to UIViewController, UITableViewDataSource and UITableViewDelegate to implement table view.Below is an example of a class implementing UIViewController.class ViewController : UIViewController { @IBOutlet weak var sampleView: UIView! ... Read More

How do I make a dotted/dashed line in Android?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

2K+ Views

This example demonstrates how do I make a dotted/dashed line in Android.Step 1 - Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 - Add the following code to res/layout/activity_main.xml.         In the above code, we have text view with image view. Image view contains a dotted background. So create dotted.xml in drawable as shown below -             Step 3 - Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import ... Read More

Why are chinese electronics most popular in the market?

yashwanth sitamraju
Updated on 30-Jul-2019 22:30:24

77 Views

Chinese products were once as cheap and low-quality brand but now they are no longer considered that way. Starting from the consumer electronics like mobiles, Televisions, refrigerators to fitness gadgets and wearable devices, China is giving its Indian counterpart a tough competition in the market.Last September a Beijing based company launched a product with the flash online sale in the 4K high definition TV segment. The sale of 55inch TV which was priced fewer than 60, 000 lasted all of three minutes.It bagged 4, 600 units and stocked out for the day. Seeing this, Videocon has immediately reacted and has ... Read More

MySQL UPDATE the corresponding column with random number between 1-3?

George John
Updated on 30-Jul-2019 22:30:24

719 Views

For random numbers in a range, you need to use the RAND() method from MySQL. The syntax is as follows for update −UPDATE yourTableName set yourColumnName=value where yourColumnName2=(SELECT FLOOR(1+RAND()*3));In the above query, the statement FLOOR(1+RAND()*3) generates the number between 1-3 and update the column.To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table updateRowWith1To3 -> ( -> Id int, -> Name varchar(100) -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the ... Read More

8085 Program to convert two-digit hex to two ASCII values

Anvi Jain
Updated on 30-Jul-2019 22:30:24

209 Views

Now let us see a program of Intel 8085 Microprocessor. This program will convert 8-bit numbers to two digit ASCII values.Problem StatementWrite 8085 Assembly language program where an 8-bit binary number is stored in memory location 8050H. Separate each nibbles and convert it to corresponding ASCII code and store it to the memory location 8060H and 8061H.DiscussionIn this problem we are using a subroutine to convert one hexa-decimal digit (nibble) to its equivalent ASCII values. As the 8-bit number contains two nibbles, so we can execute this subroutine to find ASCII values of them. We can get the lower nibble ... Read More

How to set background for Navigation Bar in iOS?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

1K+ Views

To set the background color for a navigation bar we can either do it programmatically or through the storyboard if it is on storyboard.Method 1Let's see how to change the background color of a navigation bar through the storyboard editor.Create a new project, select it's view controller and embed in navigation controller.Select the navigation bar and go to It's attribute inspector.This is how it looks in the Xcode 10. You can select the tint color from there and it will be changed for the navigation controller.Method 2Programmatically changing the navigation background.To programmatically change it, go to the view controller and ... Read More

Check if a particular element exists in Java LinkedHashSet

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

165 Views

Use the contains() method to check if a specific element exists in LinkedHashSet or not.Let us first create a LinkedHashSet and add some elements −LinkedHashSet l = new LinkedHashSet(); l.add(new String("1")); l.add(new String("2")); l.add(new String("3")); l.add(new String("4")); l.add(new String("5")); l.add(new String("6")); l.add(new String("7"));Now, check whether it contains element “5” or not −l.contains("5")The following is an example to check if a particular element exists in LinkedHashSet −Example Live Demoimport java.util.*; public class Demo {    public static void main(String[] args) {       LinkedHashSet l = new LinkedHashSet();       l.add(new String("1"));       l.add(new String("2"));       ... Read More

What is Adverb Clause in English grammar?

Ridhi Arora
Updated on 30-Jul-2019 22:30:24

93 Views

An adverb clause is a subordinate clause that functions as an adverb. It modifies a verb, an adjective, or adverb. The adverb itself is a word which qualifies a verb or adjective or a pronoun.ExampleWhen the last guest left the party, we started dancing.If I make a promise, I won't break it.Here, when the last guest left the party and if I make a promise are adverb clauses.TypeQuestion answeredExamplePlaceWhere?Wherever there are calculators, there is Casio.TimeWhen?After the fruit is ripe, it is sold at the market.CauseWhy? (What caused this?)I didn't call her because I'm busy.PurposeWhy? (What was the reason for doing ... Read More

MySQL strip time component from datetime?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

1K+ Views

You can strip time component from datetime with the help of DATE() function. The syntax is as follows −SELECT DATE(yourColumnName) from yourTableName;To understand the above concept, let us first create a table −mysql> create table StripComponentDatetimeDemo -> ( -> YourDateTime datetime -> ); Query OK, 0 rows affected (0.60 sec)Let us now insert some records in the table. The query is as follows −mysql> insert into StripComponentDatetimeDemo values(date_add(now(), interval 1 day)); Query OK, 1 row affected (0.13 sec)Display records with the help of select statement. The query is as follows displaying ... Read More

Advertisements