Saturday, 30 May 2015

Android 6.0 (Marshmallow) features


After months of waiting, Google has finally announced that the next version of its mobile OS Android will be called Marshmallow. Also, it the next update of the OS will be numbered Android 6.0, instead of Android 5.2 as previously speculated.


Announced at Google I/O 2015, Android Marshmallow brings with it a number of new features to spruce up your smartphones and tablets (provided they get the update). Here we take a look at 10 of the features you can look look forward to with the next build of Android…

Native fingerprint support

We've seen some smartphone manufacturers already include fingerprint scanners in their devices, but with Android M, Google is looking to make the support standardized across the whole platform. To confirm rumors, native fingerprint support is coming to Android M using a standard API. That will mean that devices with a fingerprint scanner, like the Samsung Galaxy S6, can offer the same range of features.

The new feature will make it easy for Android phones with fingerprint readers to support mobile payments. You can authorize Android Pay transactions, and support can be integrated into other apps, so anyone will be able to use it.

With a partnership with Google on Lollipop, Samsung delivered important bits of code to the Android operating system with its SELinux security reinforcements.

The new fingerprint scanner support to stock Android will now benefit the entire Android ecosystem. This would effectively restrict the access of Android phones to their owners, something which is so far only possible on some of the high-end flagships from a select few manufacturers.

Web experience

Google has been exploring trends in the way web content is consumed to provide a better user-experience when interacting with websites and apps. "Chrome Custom Tabs is a new feature that gives developers a way to harness all of Chrome's capabilities, while still keeping control of the look and feel of the experience," said Burke.
Chrome Custom Tabs will allow apps to open a customized Chrome window on top of the active app, instead of launching the Chrome app separately. This will provide a faster and more intuitive user-experience when navigating between apps and the web. 
Chrome Custom Tabs supports automatic sign-in, saved passwords, autofill, and multi-process security to assist the integration of the app and web experience. So, for example, a Pinterest custom tab will have a Pinterest share button embedded in it, can include custom overflow menu options and doesn't require the Pinterest developers to build their own web browser.


Android Pay

Left off on Lollipop, one of the big introductions of Android M is Android Pay. It will be pre-installed on Android 4.4+ devices and will be supported on devices with NFC running Android KitKat and above without opening any app. Android Pay is secure because a virtual card number is created when you register a payment card, rather than an actual card number.

Using an open API, Android Pay will be available through Android's own app, or integrated into other bank apps. It will be available in the US, compatible with existing contactless payment locations, such as those that currently accept Apple Pay (a must to compete with Apple Pay's distribution) both at stores and in apps using their fingerprint.

It also means that app developers will be able to use a user's fingerprint for verification. Android Pay launch will be with Android M later in the year.


Improved battery life

One of the biggest announcements pertaining to Android M is a feature called Doze, and it has everything to do with saving precious juice on those baby batteries. Battery life has been something of concern for Android users since the beginning, and it looks like Google is taking measures to improve it.

Doze is a system state that will idle your device and background apps to a near-off state when you haven't used it for a while, a tactic that can make your phone last twice as long as it would if your Lollipop phone were on standby with Project Volta. With an OS like Android which supports multitasking, there's always a delicate balance between managing power and keeping applications running in the background updated.

Project Volta was supposed to change the fact that Android wasn't battery efficient. Like many other occasions where Google failed to deliver with Lollipop, the company is working hard to finally push through its vision of improving the way it collects location data and other information.

The search giant says it grabbed two Nexus 9 tablets, one running Lollipop and the other Android M, loaded the same apps and settings on both and then tested the standby power drain on the two. Apparently the Nexus 9 running Android M lasted up to two times longer than its Lollipop counterpart. It sounds impressive and we're hoping it translates to noticeably better battery life on our devices.

Your device will use motion detection to realize when it hasn't moved for an extended period of time and switches to a deeper sleep which consumes much less power. And, luckily, your device won't be completely useless in this mode, as Doze still allows alarms and key notifications to come through.

This comes with one sacrifice: apps don't stay as "fresh," meaning they won't be fully up-to-date with the latest information while your phone is dozing. That's a small price to pay for double the battery life, though.

Charging

Besides making our batteries last longer, Android M is also bringing faster charging with USB-C support, which is a new type of USB connector which, like Apple's Lightning connector, can be plugged in either way round and allows for faster and easier charging. It also lets users charge other devices with their Android phone, which isn't something any of us have asked for, but it's there.

Burke said on stage that it would be "coming to a device near you soon" -- that's the biggest hint at the next Nexus yet. Also, because USB Type-C works both ways, you'll get options for what you want to do when you connect a device. No more fumbling in the dark trying to plug in your charging cable the right way round.

Google claims devices with USB-C connectors will charge three- to five-times faster than the current microUSB offerings on the market.

Apps permissions

One of the big parts of Android M is a redesigned apps permissions system. Users will be able to approve or deny security permissions, such as camera or location access, on a case-by-case basis.

Currently, when you install an Android app, you agree to a range of permissions, such as what the app has access to. In Android M, you don't have to agree to things you don't want agree to. Instead, apps will ask permissions when you use a feature, rather than at installation.

This means that a user can grant applications some permissions but not others, and they can manage permissions access after the fact. It also makes it more clear to the user what an application is asking to do.

There are only eight categories of permissions available to apps now, and the apps will ask for them as they're needed. That's different from how Android currently works: Users are asked to approve all permissions at once when the app is installed. You'll be able to update the permissions at times other than installation, too, so if you don't want microphone permission, for example, you can cancel it.

More Android M features

Other improvements include changes to how text selection works, and further changes to the not-very-popular alterations to volume controls that were made in Android Lollipop. Google has simplified volume controls once again with the Android M update, with more granular control over the various audio settings on your device from ringtones and alarms to music playback and voice calls.

For Android M, Google is also revamping the web browsing experience with its Chrome browser. A new feature called Chrome Custom Tabs lets developers insert webviews directly in their apps, giving them the full power of Chrome without having to force the user to switch apps.

Essentially this feature allows applications to have the Chrome browser run atop their app whenever the user clicks on a link. This means that all of a user's autofill data, passwords, and cache are available when they open links within an application.

Android's built-in app linking system (also known as intents) is getting an upgrade, allowing apps to open content directly instead of stopping users with a dialogue box everytime.

With Android M, app developers can now have the operating system verify that certain types of links are meant to be opened with their app by checking with the web server what those links point to and verifying that it's meant to be opened with that app.

This year's release is accompanied by a preview for developers so they can test their apps and give Google feedback on the changes that they are making to Android. The Android M developer preview will be available today for the Nexus 5, Nexus 6, Nexus 9 and Nexus Player. The public will get its hands on it in Q3 2015.

Google Now 

Google Now has been improved upon once again in Android M. Focusing on three key ares: being aware of different contexts, providing answers and helping you take action, Google Now is now smarter than ever.

Google Now's context awareness understand over 100 million different places, so when you ask ''How far is it to there?'' Google Now know exactly which ''there'' you're referring to. This awareness is compounded by Google's Knowledge Graph, which understands one billion different entities, from sports teams to gas stations, TV shows to recipes.


Google Now is also rolling out a pilot program called ''Now on Tap'' with 100 popular apps. Now on Tap provides Google Now-like content right where you are, without having to leave the app you're in. So if you're in Spotify and say ''Ok Google, what is his real name?'' Now on Tap will know you're talking about the musician you're listening to and provide search results right there an then.

The same goes for content in emails. If someone asks you a question about a restaurant and to not forget something on your way home, Now on Tap can automatically pop up a restaurant card with Maps info, Yelp, OpenTable and the dialer, as well as offer to set a reminder for whatever it was you were supposed to not forget.


Google Chrome 
Chrome is also leaner and faster than ever before. Initially revamped with Android One devices in mind, where stable and speedy internet connections are not always possible, Chrome's new optimizations are set to arrive for everyone.

Chrome is now aware of network strength and can modify what you see as a result. For example, if your connection is bad, you might see colored squares rather than preview images in Search results. Optimized web pages will load four times faster and use 80 percent fewer bytes. You'll also see a memory usage reduction of up to 80 MB. Chrome will also support offline mode.

Google Photos 

As expected, Google pulled the wraps off its new Google Photos service. Previously a part of Google+, Google Photos is now standalone photo and video storage and sharing service that provides unlimited free storage for up to 16 MP photos and 1080p video. That is seriously impressive.

The Google Photos service stores high-quality compressed versions of your photos and movies but doesn't store anything on your device, so you can search through thousands of photos at high speed and without bogging your device down with gigabytes of photos.  


Popular features like Auto-Awesome and Stories are a key highlight, accessible through a new Assistant feature, which will automatically suggest creative uses of your images and footage. Through simple pinch gestures you can see tiled images for particular days, weeks, months or even years and then zoom right back in at any point you like.

Google Photos is also powerful for search, as you'd expect. You can search by People, Places, Things and Types, which are all automatically created, and you can drill down in each of those categories to see, for example, every picture you have of a particular person, all without ever tagging them. 

Sharing is also a breeze. You don't even need you contacts to have the Google Photos app. You can simply share a link that they can view in Chrome. If they are logged in they can easily download an entire album in seconds.




Saturday, 2 May 2015

verilog code for mejority detector

MEJORITY DETECTOR

module majority
(input v1,v2,v3,
output reg m);
always@(v1 or v2 or v3)
begin
            if((v1&&v2)|(v2&&v3)|(v3&&v1))
            m=1;
            else
            m=0;
end
endmodule

TESTBENCH

module majority_tb;
reg v1,v2,v3;
wire m;
majority m1(v1,v2,v3,m);
initial
begin
v1=0;v2=0;v3=0;
$monitor($time, ,,v1,v2,v3,,"m=%d",m);
#2 v1=0;v2=0;v3=0;
#2 v1=0;v2=0;v3=1;
#2 v1=0;v2=1;v3=1;
#2 v1=1;v2=0;v3=0;
#2 v1=1;v2=0;v3=1;
#2 v1=1;v2=1;v3=0;
#2 v1=1;v2=1;v3=1;
end
endmodule

You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html

verilog code for counter

COUNTER INCREMENT BY 2

module counter2(r,clk,y);
input r,clk;
output [3:0]y;
reg [3:0]y;
always@(posedge clk or posedge r)
begin
if (r)
y <= 4'b0000;
else
y <= y + 2;
end
endmodule

TESTBENCH

module counter3_tb;
reg r,clk;
wire [3:0]y;
counter2 m1(r,clk,y);
initial
begin
clk=0;
r=0;
$monitor($time, ,,"c=%b",clk,,"r=%b",r,,"y=%b",y);
#5 r=1;
#15 r=0;
#50 $finish;
end
always
begin
#5 clk=~clk;
end
endmodule

OUTPUT



·         COUNTER INCREMENT BY 3

module counter2(r,clk,y);
input r,clk;
output [3:0]y;
reg [3:0]y;
always@(posedge clk or posedge r)
begin
if (r)
y <= 4'b0000;
else
y <= y + 3;
end
endmodule

TESTBENCH

module counter3_tb;
reg r,clk;
wire [3:0]y;
counter2 m1(r,clk,y);
initial
begin
clk=0;
r=0;
$monitor($time, ,,"c=%b",clk,,"r=%b",r,,"y=%b",y);
#5 r=1;
#15 r=0;
#50 $finish;
end
always
begin
#5 clk=~clk;
end
endmodule

verilog code for berral shifter

BERRAL SHIFTER



module bshift
(
input [7:0]a,
input [2:0]sh,
input left,right,
output reg [7:0] b);

always@(a,sh)
begin

if(left)
begin
case(sh)
3'b000: b = a;
3'b001: b = a<<1;
3'b010: b = a<<2;
3'b011: b = a<<3;
3'b100: b = a<<4;
3'b101: b = a<<5;
3'b110: b = a<<6;
3'b111: b = a<<7;
endcase
end

if(right)
begin
case(sh)
3'b000: b = a;
3'b001: b = a>>1;
3'b010: b = a>>2;
3'b011: b = a>>3;
3'b100: b = a>>4;
3'b101: b = a>>5;
3'b110: b = a>>6;
3'b111: b = a>>7;
endcase
end

end
endmodule

TESTBENCH

module bshift_tb;
reg [7:0] a;
reg [2:0] sh,left,right;
wire [7:0] b;

bshift bs(a,sh,left,right,b);

initial
begin
sh=3'b000;a=8'b11111111;left=1'b1;right=1'b0;
$monitor($time, ,"lef","ft=",left, ,"rig","ht=",right, ,"shi","ft", ,"%b",sh,  ,"inp","ut", ,"%b",a,   ,"out","put", ,"%b",b);
end

always
#1 sh=sh+1;

initial
#9 left=1'b0;
initial
#10 right=1'b1;

initial
#18 $stop;

endmodule


You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html

verilog code for 16x2 mux using 2x1

16x2 MUX USING 2X1 MUX USING STRUCTRAL MODELING

module mux16to1
(
input [15:0]w,
input [3:0]s,
output wire [15:0]m,
output f);

mux2to1 mu1(m[0],w[1:0],s[0]);
mux2to1 mu2(m[1],w[3:2],s[0]);
mux2to1 mu3(m[2],w[5:4],s[0]);
mux2to1 mu4(m[3],w[7:6],s[0]);
mux2to1 mu5(m[4],w[9:8],s[0]);
mux2to1 mu6(m[5],w[11:10],s[0]);
mux2to1 mu7(m[6],w[13:12],s[0]);
mux2to1 mu8(m[7],w[15:14],s[0]);
mux2to1 mu9(m[8],m[1:0],s[1]);
mux2to1 mu10(m[9],m[3:2],s[1]);
mux2to1 mu11(m[10],m[5:4],s[1]);
mux2to1 mu12(m[11],m[7:6],s[1]);
mux2to1 mu13(m[12],m[9:8],s[2]);
mux2to1 mu14(m[13],m[11:10],s[2]);
mux2to1 mu15(f,m[13:12],s[3]);

endmodule

module mux2to1
(
output f,
input [1:0]w,sel
);
and m1(x,w[0],~sel);
and m2(y,w[1],sel);
or m3(f,x,y);
endmodule

TESTBENCH

module mux16to1_tb;

reg [15:0]w;
reg [3:0]s;
wire [15:0]m;
wire f;

mux16to1 m16to1(w,s,m,f);

initial
begin
w=16'b1010101010101010;
s=4'b0000;
$monitor($time, ,"inp",   ,"%b",w,  ,"sel", ,"%b",s,  ,"out", ,f);

end
always
#1 s=s+1;

initial
#16 $stop;
endmodule




You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html

verilog code for 4 -bit ripple carry adder using full adder

 4-BIT RIPPLE CARRY ADDER USING FULL ADDER

           
module rip2(s,cout,a,b,cin);
  input [3:0]a;
  input [3:0]b;
  input cin;
  output cout;
  output [3:0]s;
  wire c2,c3,c4,cout;
  fa m1(s[0],c2,a[0],b[0],cin);
  fa m2(s[1],c3,a[1],b[1],c2);
  fa m3(s[2],c4,a[2],b[2],c3);
  fa m4(s[3],cout,a[3],b[3],c4);
endmodule

TESTBENCH

module fa(s,cout,a,b,cin);
input a,b,cin;
output s,cout;
wire w1,w2,w3;
ha m1(w1,w2,a,b);
ha m2(s,w3,w1,cin);
or m3(cout,w2,w3);
endmodule

module ha(s,cout,a,b);      //sub module for Half adder
  input a,b;
  output s,cout;
  xor m1(s,a,b);
  and m2(cout,a,b);
endmodule

module rip2_tb;
reg [3:0]a;
reg [3:0]b;
reg cin;
wire cout;
wire [3:0]s;
rip2 m1(s,cout,a,b,cin);
initial
begin
a=4'b0000;b=4'b0000;cin=0;
$monitor($time, ,,"a=%b",a,,"b=%b",b,,"c=%b",cin,,"d=%b",cout,,"s=%b",s);
#5 a=4'b0000;b=4'b0000;cin=0;
#5 a=4'b0001;b=4'b0000;cin=1;
#5 a=4'b1100;b=4'b1100;cin=1;
#5 a=4'b1100;b=4'b1100;cin=0;
#5 a=4'b1101;b=4'b1101;cin=1;
#5 a=4'b0001;b=4'b1000;cin=1;
#5 a=4'b0000;b=4'b1111;cin=1;
#5 a=4'b1100;b=4'b1100;cin=0;
#5 a=4'b0000;b=4'b0111;cin=1;
#5 a=4'b1100;b=4'b0010;cin=1;
end
endmodule


You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html

verilod code for n-bit binary to gray converter

-BIT BINARY TO GRAY CONVERTER

module binary2gray #(parameter n=4)
(
input [n-1:0] b,
output [n-1:0] g     
);
assign g={b[n],b[n:1]^b[n-1:0]};
endmodule

TESTBENCH

module binary2gray_tb;
parameter n=4;
reg [n-1:0]b;
wire [n-1:0]g;
binary2gray b2g(b,g);
initial
begin
#1 b=4'b1111;
$monitor($time,  ,"bin","ary=","%b",b, ,"gra","y=","%b",g);
end

always

#1 b=b+1;

initial
#10 $stop;
endmodule

verilog code for n-bit gray to binary converter

N-BIT  GRAY TO BINARY CONVERTER

module binary2gray #(parameter n=4)
(
input [n-1:0] g,
output [n-1:0] b
);
assign b={g[n],b[n:1]^g[n-1:0]};
endmodule

TESTBENCH

module binary2gray_tb;
parameter n=4;
reg [n-1:0]g;
wire [n-1:0]b;
binary2gray b2g(.b(b),.g(g));
initial
begin
#1 g=4'b1111;
$monitor($time,  ,"gra","y","%b",g, ,"bin","ary","%b",b);
end

always

#1 g=g+1;

initial
#10 $stop;
endmodule

You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html

verilog code for d-latch using dataflow

·         D LATCH USING DATAFLOW

module latch_d
(input e, D,
output Q);
assign Q=e&D;
endmodule


TESTBENCH

module latch_d_tb;
reg e,D;
wire q;
latch_d m(e,D,q);
initial
begin
e=0;D=0;
$monitor($time, ,,"e=%b",e,,"D=%b",D,,"q=%b",q);
#1 e=0;D=0;
#1 e=1;D=0;
#1 e=0;D=1;
#1 e=1;D=1;
end
endmodule


You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html

verilog code for bcd to binary



BCD TO BINARY


module bcd2binary
(input [7:0]bcd,
output reg[3:0]binary);

always@(bcd)
begin
if(bcd[3:0]<4'b1010)
begin
if(bcd[7:4]=={4{1'b0}})
binary=bcd[3:0];
if((bcd[7:5]=={3{1'b0}})&&(bcd[4]==1'b1))
binary=bcd[3:0]+4'b1010;
end
else
binary={4{1'bx}};

end
endmodule

TEST BENCH

module bcd2binary_tb;
reg [7:0]bcd;
wire [3:0]binary;

bcd2binary b1(bcd,binary);
initial
begin
bcd=8'b00000000;
$monitor($time, ,"bcd", ,"%b",bcd,  , "bin","ary", ,"%b",binary);
end

always
#1 bcd=bcd+1;

initial
#22 $stop;
endmodule


You can also check more verilog code on

http://kaneriadhaval.blogspot.in/2013/11/all-besic-verilog-code.html