The world is changing. Technology used to be just a small piece of our world, limited to computers and mainframes in the 1980s. Today the world is becoming increasingly digital. 

According to the Brookings Institute, the world's digital economy is worth $11.5 trillion, and has grown more than twice as fast as the broader economy over the past 15 years. In other words, technology isn't a niche of the economy; it's becoming the economy.

Consider that when building a diversified investment portfolio. Suppose you receive a hypothetical windfall of $50,000. This is just an example -- you can change the numbers to resemble your situation. Here is how I would invest it, assuming I already had a diversified portfolio in place.

$12,500 each to:

1. Alphabet

Google and YouTube are the two most visited websites worldwide, and by a wide margin. And internet conglomerate Alphabet (GOOGL 10.22%) owns them both. The company makes money by selling ads to you when you're on these sites, as well as through some secondary businesses like cloud computing. Alphabet nearly monopolizes internet search, with an estimated 83% of the global market share.

GOOGL PE Ratio (Forward) Chart

GOOGL PE Ratio (Forward) data by YCharts

Alphabet is investing heavily in generative AI, and can utilize the massive hoard of user data it has collected from its years of dominating search. Despite already having a $1.7 trillion market cap, analysts believe the company's earnings will grow by an average of 17% annually in the future. Considering the potential growth and dominant market position, the stock seems like a solid value at a forward P/E ratio of 24.

2. CrowdStrike Holdings

Cybersecurity only becomes more important as the world moves online. A company can suffer millions of dollars in damages if hacked, and its reputation can suffer if private customer data gets exposed. IBM estimates that the average breach costs corporations more than $4 million. CrowdStrike Holdings (CRWD 2.03%) is part of a new generation of security solutions providing proactive protection through its Falcon platform.

CRWD PE Ratio (Forward) Chart

CRWD PE Ratio (Forward) data by YCharts

CrowdStrike has a lot of room to grow. It has roughly 23,000 customers, a growing user base it can upsell to. Approximately 63% of the company's customers use at least five products. Importantly, CrowdStrike is growing without sacrificing profits, converting 26% of its revenue to cash flow. Analysts believe the company's earnings will grow by 45% annually, making the stock's forward P/E of 65 very reasonable for long-term investors.

3. Microsoft

Technology changes constantly, but Microsoft (MSFT 1.82%) has stayed relevant for decades. The company built desktop operating systems, which remains a thriving business today -- most computers use Windows. Additionally, Microsoft has assembled a collection of businesses, ranging from cloud computing to video games and enterprise software. Stacking revenue streams has created a multi-trillion-dollar monster; Microsoft is one of the world's largest companies, worth $2.4 trillion today.

MSFT PE Ratio (Forward) Chart

MSFT PE Ratio (Forward) data by YCharts

Microsoft is almost a must-own for any long-term investor because of how big it is and how much cash it creates. Microsoft generated $59 billion in free cash flow over the past year, more than most companies do in sales.

Microsoft is a technology stalwart, however, and that dependability will cost you: The stock trades at a forward P/E of 30, and analysts expect 13% annual earnings growth moving forward. That's not a bargain, but you pay for the quality.

4. Nvidia

Semiconductors are the tiny chips that make technology work. You could think of them as building blocks for the digital economy. Nvidia (NVDA 6.18%) has emerged as a dominant player in artificial intelligence because almost everyone is building on its chips. Some analysts believe Nvidia's AI chips have as high as 80% to 95% of the market share. That may not last forever if competitors step in, but AI could be such a massive opportunity that Nvidia may still make tons of money for shareholders.

NVDA PE Ratio (Forward) Chart

NVDA PE Ratio (Forward) data by YCharts

Wall Street has spent this year scrambling to raise growth estimates after Nvidia's first two earnings reports this year shocked investors with surging growth. Analysts now believe the company can grow profits by 33% annually, and shares trade at a forward P/E of 42. That's a reasonable price tag for long-term investors, even after shares have risen 300% in 12 months.